]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Nov 2012 15:39:22 +0000 (16:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Nov 2012 15:39:22 +0000 (16:39 +0100)
added patches:
batman-adv-fix-broadcast-packet-crc-calculation.patch

queue-3.6/batman-adv-fix-broadcast-packet-crc-calculation.patch [new file with mode: 0644]
queue-3.6/series

diff --git a/queue-3.6/batman-adv-fix-broadcast-packet-crc-calculation.patch b/queue-3.6/batman-adv-fix-broadcast-packet-crc-calculation.patch
new file mode 100644 (file)
index 0000000..f93328d
--- /dev/null
@@ -0,0 +1,78 @@
+From 7f112af40fecf5399b61e69ffc6b55a9d82789f7 Mon Sep 17 00:00:00 2001
+From: Linus Lüssing <linus.luessing@web.de>
+Date: Wed, 17 Oct 2012 14:53:04 +0200
+Subject: batman-adv: Fix broadcast packet CRC calculation
+
+From: Linus Lüssing <linus.luessing@web.de>
+
+commit 7f112af40fecf5399b61e69ffc6b55a9d82789f7 upstream.
+
+So far the crc16 checksum for a batman-adv broadcast data packet, received
+on a batman-adv hard interface, was calculated over zero bytes of its
+content leading to many incoming broadcast data packets wrongly being
+dropped (60-80% packet loss).
+
+This patch fixes this issue by calculating the crc16 over the actual,
+complete broadcast payload.
+
+The issue is a regression introduced by
+("batman-adv: add broadcast duplicate check").
+
+Signed-off-by: Linus Lüssing <linus.luessing@web.de>
+Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
+Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/batman-adv/bridge_loop_avoidance.c |    8 ++++----
+ net/batman-adv/routing.c               |    8 +++++++-
+ 2 files changed, 11 insertions(+), 5 deletions(-)
+
+--- a/net/batman-adv/bridge_loop_avoidance.c
++++ b/net/batman-adv/bridge_loop_avoidance.c
+@@ -1205,8 +1205,8 @@ int batadv_bla_init(struct batadv_priv *
+ /**
+  * batadv_bla_check_bcast_duplist
+  * @bat_priv: the bat priv with all the soft interface information
+- * @bcast_packet: originator mac address
+- * @hdr_size: maximum length of the frame
++ * @bcast_packet: encapsulated broadcast frame plus batman header
++ * @bcast_packet_len: length of encapsulated broadcast frame plus batman header
+  *
+  * check if it is on our broadcast list. Another gateway might
+  * have sent the same packet because it is connected to the same backbone,
+@@ -1219,14 +1219,14 @@ int batadv_bla_init(struct batadv_priv *
+  */
+ int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
+                                  struct batadv_bcast_packet *bcast_packet,
+-                                 int hdr_size)
++                                 int bcast_packet_len)
+ {
+       int i, length, curr;
+       uint8_t *content;
+       uint16_t crc;
+       struct batadv_bcast_duplist_entry *entry;
+-      length = hdr_size - sizeof(*bcast_packet);
++      length = bcast_packet_len - sizeof(*bcast_packet);
+       content = (uint8_t *)bcast_packet;
+       content += sizeof(*bcast_packet);
+--- a/net/batman-adv/routing.c
++++ b/net/batman-adv/routing.c
+@@ -1136,8 +1136,14 @@ int batadv_recv_bcast_packet(struct sk_b
+       spin_unlock_bh(&orig_node->bcast_seqno_lock);
++      /* keep skb linear for crc calculation */
++      if (skb_linearize(skb) < 0)
++              goto out;
++
++      bcast_packet = (struct batadv_bcast_packet *)skb->data;
++
+       /* check whether this has been sent by another originator before */
+-      if (batadv_bla_check_bcast_duplist(bat_priv, bcast_packet, hdr_size))
++      if (batadv_bla_check_bcast_duplist(bat_priv, bcast_packet, skb->len))
+               goto out;
+       /* rebroadcast packet */
index 35ae4b7961a579b9eb357a3253b17edcc53d6b20..b94c40a7aadf365f0b850b4500e6e6afec2dba57 100644 (file)
@@ -30,3 +30,4 @@ nfsv4-nfs4_locku_done-must-release-the-sequence-id.patch
 nfsv4.1-we-must-release-the-sequence-id-when-we-fail-to-get-a-session-slot.patch
 nfs-wait-for-session-recovery-to-finish-before-returning.patch
 nfs-fix-bug-in-legacy-dns-resolver.patch
+batman-adv-fix-broadcast-packet-crc-calculation.patch