The following commit has been merged in the next branch:
commit 7f1b2a091195b47d85576fa72fb97eaa07a4b5b9
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sun Oct 16 20:32:02 2011 +0200
batman-adv: linearise the tt_response skb only if needed
The TT_RESPONSE skb has to be linearised only if the node plans to access the
packet payload (so only if the message is directed to that node). In all the
other cases the node can avoid this memory operation
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
diff --git a/routing.c b/routing.c
index 60ce407..e0e7b7b 100644
--- a/routing.c
+++ b/routing.c
@@ -616,13 +616,14 @@ int recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
}
break;
case TT_RESPONSE:
- /* packet needs to be linearized to access the TT changes */
- if (skb_linearize(skb) < 0)
- goto out;
+ if (is_my_mac(tt_query->dst)) {
+ /* packet needs to be linearized to access the TT
+ * changes */
+ if (skb_linearize(skb) < 0)
+ goto out;
- if (is_my_mac(tt_query->dst))
handle_tt_response(bat_priv, tt_query);
- else {
+ } else {
bat_dbg(DBG_TT, bat_priv,
"Routing TT_RESPONSE to %pM [%c]\n",
tt_query->dst,
--
batman-adv
The following commit has been merged in the next branch:
commit e096f3862a486fd1a1cf024baf7e0b9f93dec6b9
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sun Oct 16 20:32:03 2011 +0200
batman-adv: check for tt_reponse packet real length
Before accessing the TT_RESPONSE packet payload, the node has to ensure that the
packet is long enough as it would expect to be.
Reported-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
diff --git a/routing.c b/routing.c
index e0e7b7b..ef24a72 100644
--- a/routing.c
+++ b/routing.c
@@ -578,6 +578,7 @@ int recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
{
struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
struct tt_query_packet *tt_query;
+ uint16_t tt_len;
struct ethhdr *ethhdr;
/* drop packet if it has not necessary minimum size */
@@ -622,6 +623,14 @@ int recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
if (skb_linearize(skb) < 0)
goto out;
+ tt_len = tt_query->tt_data * sizeof(struct tt_change);
+
+ /* Ensure we have all the claimed data */
+ if (unlikely(skb_headlen(skb) <
+ sizeof(struct tt_query_packet) +
+ tt_len))
+ goto out;
+
handle_tt_response(bat_priv, tt_query);
} else {
bat_dbg(DBG_TT, bat_priv,
--
batman-adv
The following commit has been merged in the next branch:
commit 00ca20ef24617946e37bf69ca0a374f86ea56e6b
Author: Simon Wunderlich <simon.wunderlich(a)s2003.tu-chemnitz.de>
Date: Sun Oct 30 16:22:43 2011 +0100
batman-adv: Fix range check for expected packets
The check for new packets in the future used a wrong binary operator,
which makes the check expression always true and accepting too many
packets.
Reported-by: Thomas Jarosch <thomas.jarosch(a)intra2net.com>
Signed-off-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
diff --git a/bitarray.c b/bitarray.c
index 0be9ff3..9bc63b2 100644
--- a/bitarray.c
+++ b/bitarray.c
@@ -155,7 +155,7 @@ int bit_get_packet(void *priv, unsigned long *seq_bits,
/* sequence number is much newer, probably missed a lot of packets */
if ((seq_num_diff >= TQ_LOCAL_WINDOW_SIZE)
- || (seq_num_diff < EXPECTED_SEQNO_RANGE)) {
+ && (seq_num_diff < EXPECTED_SEQNO_RANGE)) {
bat_dbg(DBG_BATMAN, bat_priv,
"We missed a lot of packets (%i) !\n",
seq_num_diff - 1);
--
batman-adv
The following commit has been merged in the next branch:
commit c5cb3c51eb0e58e2e8542918729fe57432933c16
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Fri Sep 30 13:32:00 2011 +0200
batman-adv: Don't use EXTRA_CFLAGS to add source version
EXTRA_CFLAGS is deprecated since v2.6.23-2309-gf77bf01 and should not be used
anymore to add additional flags for the c compiler.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/Makefile.kbuild b/Makefile.kbuild
index 6377c17..bd7e93c 100644
--- a/Makefile.kbuild
+++ b/Makefile.kbuild
@@ -25,10 +25,10 @@ ifeq ($(MAKING_MODULES),1)
-include $(TOPDIR)/Rules.make
endif
-# EXTRA_CFLAGS += -DCONFIG_BATMAN_ADV_DEBUG
+# ccflags-y += -DCONFIG_BATMAN_ADV_DEBUG
ifneq ($(REVISION),)
-EXTRA_CFLAGS += -DSOURCE_VERSION=\"$(REVISION)\"
+ccflags-y += -DSOURCE_VERSION=\"$(REVISION)\"
endif
obj-m += batman-adv.o
diff --git a/README b/README
index 1e000ee..5ba56b5 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-[state: 21-08-2011]
+[state: 30-09-2011]
BATMAN-ADV
----------
@@ -206,7 +206,7 @@ option "B.A.T.M.A.N. debugging". When compiling outside of the
kernel tree it is necessary to edit the file Makefile.kbuild and
uncomment the line
-#EXTRA_CFLAGS += -DCONFIG_BATMAN_ADV_DEBUG
+#ccflags-y += -DCONFIG_BATMAN_ADV_DEBUG
Those additional debug messages can be accessed using a special
file in debugfs
--
batman-adv
The following commit has been merged in the next branch:
commit 62c7140c15a92b65144e1b26220ee40d874db1c1
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Wed Oct 12 14:54:50 2011 +0200
batman-adv: use orig_hash_find() instead of get_orig_node() in TT code
get_orig_node() tries to retrieve an orig_node object based on a mac address
and creates it if not present. This is not the wanted behaviour in the
translation table code as we don't want to create new orig_code objects but
expect a NULL pointer if the object does not exist.
Reported-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
diff --git a/translation-table.c b/translation-table.c
index 7de9960..6102cd2 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -1170,11 +1170,11 @@ static bool send_other_tt_response(struct bat_priv *bat_priv,
(tt_request->flags & TT_FULL_TABLE ? 'F' : '.'));
/* Let's get the orig node of the REAL destination */
- req_dst_orig_node = get_orig_node(bat_priv, tt_request->dst);
+ req_dst_orig_node = orig_hash_find(bat_priv, tt_request->dst);
if (!req_dst_orig_node)
goto out;
- res_dst_orig_node = get_orig_node(bat_priv, tt_request->src);
+ res_dst_orig_node = orig_hash_find(bat_priv, tt_request->src);
if (!res_dst_orig_node)
goto out;
@@ -1300,7 +1300,7 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
my_ttvn = (uint8_t)atomic_read(&bat_priv->ttvn);
req_ttvn = tt_request->ttvn;
- orig_node = get_orig_node(bat_priv, tt_request->src);
+ orig_node = orig_hash_find(bat_priv, tt_request->src);
if (!orig_node)
goto out;
--
batman-adv