Skip to content

Commit

Permalink
batman-adv: clear control block of received socket buffers
Browse files Browse the repository at this point in the history
Since other network components (and some drivers) uses the control block
provided in skb's, the network coding feature might wrongly assume that
an SKB has been decoded, and thus not try to code it with another packet
again. This happens for instance when batman-adv is running on a bridge device.

Fix this by clearing the control block for every received SKB.

Introduced by 3c12de9
("batman-adv: network coding - code and transmit packets if possible")
Signed-off-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>

Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
  • Loading branch information
Martin Hundebøll authored and Antonio Quartulli committed Jan 7, 2015
1 parent 32db6aa commit e0d9677
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/batman-adv/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
goto err_free;
}

/* reset control block to avoid left overs from previous users */
memset(skb->cb, 0, sizeof(struct batadv_skb_cb));

/* all receive handlers return whether they received or reused
* the supplied skb. if not, we have to free the skb.
*/
Expand Down

0 comments on commit e0d9677

Please sign in to comment.