Commit 55883fd1048e09f5b6e1edaf0caf7e4f6f31f971

Authored by Antonio Quartulli
1 parent ca66304644

batman-adv: clean nf state when removing protocol header

If an interface enslaved into batman-adv is a bridge (or a
virtual interface built on top of a bridge) the nf_bridge
member of the skbs reaching the soft-interface is filled
with the state about "netfilter bridge" operations.

Then, if one of such skbs is locally delivered, the nf_bridge
member should be cleaned up to avoid that the old state
could mess up with other "netfilter bridge" operations when
entering a second bridge.
This is needed because batman-adv is an encapsulation
protocol.

However at the moment skb->nf_bridge is not released at all
leading to bogus "netfilter bridge" behaviours.

Fix this by cleaning the netfilter state of the skb before
it gets delivered to the upper layer in interface_rx().

Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

net/batman-adv/soft-interface.c
... ... @@ -346,6 +346,11 @@
346 346 skb_pull_rcsum(skb, hdr_size);
347 347 skb_reset_mac_header(skb);
348 348  
  349 + /* clean the netfilter state now that the batman-adv header has been
  350 + * removed
  351 + */
  352 + nf_reset(skb);
  353 +
349 354 vid = batadv_get_vid(skb, hdr_size);
350 355 ethhdr = eth_hdr(skb);
351 356