[commits] [linux-merge]linux integration; branch, merge/master, updated. v3.7-rc1-1515-gcbf3c88b

postmaster at open-mesh.org postmaster at open-mesh.org
Thu Oct 18 21:48:39 CEST 2012


The following commit has been merged in the merge/master branch:
commit f32a547626ff950a846197a66eea4860fa907b7b
Author: Linus Lüssing <linus.luessing at web.de>
Date:   Wed Oct 17 14:53:04 2012 +0200

    batman-adv: Fix broadcast packet CRC calculation
    
    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 at web.de>
    Acked-by: Simon Wunderlich <siwu at hrz.tu-chemnitz.de>
    Signed-off-by: Marek Lindner <lindner_marek at yahoo.de>

diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 0a9084a..eebab20 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -1210,8 +1210,8 @@ int batadv_bla_init(struct batadv_priv *bat_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,
@@ -1224,14 +1224,14 @@ int batadv_bla_init(struct batadv_priv *bat_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);
 
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 939fc01..376b4cc 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -1124,8 +1124,14 @@ int batadv_recv_bcast_packet(struct sk_buff *skb,
 
 	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 */

-- 
linux integration


More information about the commits mailing list