The following commit has been merged in the master branch:
commit 5f3776affad426fc2c00be3fb04c1bc1158829c5
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sun Nov 20 16:35:16 2011 +0100
batctl: Return failure code when ping was not successful
The standard iputils-ping returns an error code when it could not receive a
single reply to a echo request. batctl ping behaved differently and made it
only possible to detect that the target is not reachable by parsing the text
output of batctl.
A new return code EXIT_NOSUCCESS (2) is introduced to distinguish a general
failure from the inability to reach another node.
Reported-by: Filippo Sallemi <tonyputi(a)gmail.com>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/main.h b/main.h
index e5a3e01..fb7ca38 100644
--- a/main.h
+++ b/main.h
@@ -25,4 +25,6 @@
#define SOCKET_PATH_FMT "%s/batman_adv/%s/socket"
+#define EXIT_NOSUCCESS 2
+
#define __packed __attribute((packed)) /* linux kernel compat */
diff --git a/ping.c b/ping.c
index d880290..b7c2932 100644
--- a/ping.c
+++ b/ping.c
@@ -322,7 +322,10 @@ sleep:
printf("rtt min/avg/max/mdev = %.3f/%.3f/%.3f/%.3f ms\n",
min, avg, max, mdev);
- ret = EXIT_SUCCESS;
+ if (packets_in)
+ ret = EXIT_SUCCESS;
+ else
+ ret = EXIT_NOSUCCESS;
out:
bat_hosts_free();
--
batctl
The following commit has been merged in the master branch:
commit 8ef201e01c57e3bfbcb7f6db69405ff259c2b907
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Mon Nov 7 16:36:40 2011 +0100
batman-adv: add tt_initialised flag to the orig_node struct
(ttvn == 0) is currently used as initial condition. However this is not a good
idea because ttvn gets the vale zero each time after reaching the maximum value
(wrap around). For this reason a new flag is added in order to define whether a
node has an initialised table or not. Moreover, after invoking
tt_global_del_orig(), tt_initialised has to be set to false
Reported-by: Alexey Fisher <bug-track(a)fisher-privat.net>
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Tested-by: Alexey Fisher <bug-track(a)fisher-privat.net>
diff --git a/originator.c b/originator.c
index 0bc2045..847ff7e 100644
--- a/originator.c
+++ b/originator.c
@@ -219,6 +219,7 @@ struct orig_node *get_orig_node(struct bat_priv *bat_priv, const uint8_t *addr)
/* extra reference for return */
atomic_set(&orig_node->refcount, 2);
+ orig_node->tt_initialised = false;
orig_node->tt_poss_change = false;
orig_node->bat_priv = bat_priv;
memcpy(orig_node->orig, addr, ETH_ALEN);
diff --git a/translation-table.c b/translation-table.c
index cc87acf..c0e9756 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -717,6 +717,7 @@ void tt_global_del_orig(struct bat_priv *bat_priv,
spin_unlock_bh(list_lock);
}
atomic_set(&orig_node->tt_size, 0);
+ orig_node->tt_initialised = false;
}
static void tt_global_roam_purge(struct bat_priv *bat_priv)
@@ -1476,6 +1477,7 @@ static void tt_update_changes(struct bat_priv *bat_priv,
tt_save_orig_buffer(bat_priv, orig_node, (unsigned char *)tt_change,
tt_num_changes);
atomic_set(&orig_node->last_ttvn, ttvn);
+ orig_node->tt_initialised = true;
}
bool is_my_client(struct bat_priv *bat_priv, const uint8_t *addr)
@@ -1838,8 +1840,10 @@ void tt_update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node,
uint8_t orig_ttvn = (uint8_t)atomic_read(&orig_node->last_ttvn);
bool full_table = true;
- /* the ttvn increased by one -> we can apply the attached changes */
- if (ttvn - orig_ttvn == 1) {
+ /* orig table not initialised AND first diff is in the OGM OR the ttvn
+ * increased by one -> we can apply the attached changes */
+ if ((!orig_node->tt_initialised && ttvn == 1) ||
+ ttvn - orig_ttvn == 1) {
/* the OGM could not contain the changes due to their size or
* because they have already been sent TT_OGM_APPEND_MAX times.
* In this case send a tt request */
@@ -1873,7 +1877,8 @@ void tt_update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node,
} else {
/* if we missed more than one change or our tables are not
* in sync anymore -> request fresh tt data */
- if (ttvn != orig_ttvn || orig_node->tt_crc != tt_crc) {
+ if (!orig_node->tt_initialised || ttvn != orig_ttvn ||
+ orig_node->tt_crc != tt_crc) {
request_table:
bat_dbg(DBG_TT, bat_priv, "TT inconsistency for %pM. "
"Need to retrieve the correct information "
diff --git a/types.h b/types.h
index e9eb043..35085f4 100644
--- a/types.h
+++ b/types.h
@@ -81,6 +81,7 @@ struct orig_node {
int16_t tt_buff_len;
spinlock_t tt_buff_lock; /* protects tt_buff */
atomic_t tt_size;
+ bool tt_initialised;
/* The tt_poss_change flag is used to detect an ongoing roaming phase.
* If true, then I sent a Roaming_adv to this orig_node and I have to
* inspect every packet directed to it to check whether it is still
--
batman-adv
The following commit has been merged in the next branch:
commit 5ffb8fa18ae09bc4161c484101fc51e766d28be8
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Tue Nov 15 01:09:14 2011 +0800
batctl: slightly reword batctl readme
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/README b/README
index 7119951..da0ac68 100644
--- a/README
+++ b/README
@@ -318,20 +318,21 @@ Usage: batctl translocal|tl
Example:
$ batctl translocal
-Locally retrieved addresses (from bat0) announced via TT:
- * d6:e0:fd:d9:00:00 [RPNXW]
+Locally retrieved addresses (from bat0) announced via TT (TTVN: 1):
+ * fe:fe:00:00:01:01 [RPNXW]
In particular, RPNXW are flags which have the following meanings:
- R/Roaming: this client moved to another node but it is still kept for
- consistency purposes up to the next OGM sending.
-- P/noPurge: this client represents the local soft interface and has to never be
- deleted.
-- N/New: this client has recently been added but it has to not be advertised up
- to the next OGM sending (for consistency purposes).
-- X/delete: this client has to be removed for some reason, but it is still kept
- for consistency purposes up to the next OGM sending.
-- W/Wireless: this client is connected to the node through a Wireless device.
+ consistency reasons until the next OGM is sent.
+- P/noPurge: this client represents the local soft interface and will never
+ be deleted.
+- N/New: this client has recently been added but is not advertised in the
+ mesh until the next OGM is sent (for consistency reasons).
+- X/delete: this client has to be removed for some reason, but it is still
+ kept for consistency reasons until the next OGM is sent.
+- W/Wireless: this client is connected to the node through a wireless
+ device.
If any of the flags is not enabled, a '.' will substitute its symbol.
@@ -346,7 +347,7 @@ Example:
Globally announced TT entries received via the mesh bat0
Client (TTVN) Originator (Curr TTVN) Flags
- * 16:aa:c4:a2:00:00 ( 12) via fe:fe:00:00:09:01 ( 50) [RXW]
+ * fe:fe:00:00:01:01 ( 12) via fe:fe:00:00:01:02 ( 50) [RXW]
where:
- TTVN: is the translation-table-version-number which introduced this
@@ -355,13 +356,13 @@ where:
the originator serving this client (different clients
advertised by the same originator have the same Curr TTVN)
- Flags that mean:
- - R/Roaming: this client moved to another node but it is still kept for
- consistency purposes up to the next OGM received from its
- originator
+ - R/Roaming: this client moved to another node but it is still kept
+ for consistency reasons until the next OGM is sent.
- X/delete: this client has to be removed for some reason, but it is
- still kept for consistency purposes.
- - W/Wireless: this client is connected to the node through a Wireless
- device.
+ still kept for consistency reasons until the next
+ OGM is sent.
+ - W/Wireless: this client is connected to the node through a
+ wireless device.
If any of the flags is not enabled, a '.' will substitute its symbol.
--
batctl
The following commit has been merged in the next branch:
commit 44bb66d56dd8bcbdd9f92bf43280a6b956a65652
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Mon Nov 14 10:22:13 2011 +0100
batman-adv: Start new development cycle
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/main.h b/main.h
index 53e5d9f..464439f 100644
--- a/main.h
+++ b/main.h
@@ -28,7 +28,7 @@
#define DRIVER_DEVICE "batman-adv"
#ifndef SOURCE_VERSION
-#define SOURCE_VERSION "2011.4.0"
+#define SOURCE_VERSION "2012.0.0"
#endif
/* B.A.T.M.A.N. parameters */
--
batman-adv