From: Antonio Quartulli <antonio-x4xJYDvStAgysxA8WJXlww@public.gmane.org>
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r@public.gmane.org,
Marek Lindner
<mareklindner-rVWd3aGhH2z5bpWLKbzFeg@public.gmane.org>,
Antonio Quartulli
<antonio-x4xJYDvStAgysxA8WJXlww@public.gmane.org>
Subject: [PATCH 6/7] batman-adv: clean nf state when removing protocol header
Date: Sat, 28 Dec 2013 17:05:59 +0100 [thread overview]
Message-ID: <1388246760-3335-7-git-send-email-antonio@meshcoding.com> (raw)
In-Reply-To: <1388246760-3335-1-git-send-email-antonio-x4xJYDvStAgysxA8WJXlww@public.gmane.org>
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-x4xJYDvStAgysxA8WJXlww@public.gmane.org>
Signed-off-by: Marek Lindner <mareklindner-rVWd3aGhH2z5bpWLKbzFeg@public.gmane.org>
---
net/batman-adv/soft-interface.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index b4881f8..875a702 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -346,6 +346,11 @@ void batadv_interface_rx(struct net_device *soft_iface,
skb_pull_rcsum(skb, hdr_size);
skb_reset_mac_header(skb);
+ /* clean the netfilter state now that the batman-adv header has been
+ * removed
+ */
+ nf_reset(skb);
+
vid = batadv_get_vid(skb, hdr_size);
ethhdr = eth_hdr(skb);
--
1.8.5.2
next prev parent reply other threads:[~2013-12-28 16:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-28 16:05 pull request [net]: batman-adv 2013-12-28 Antonio Quartulli
2013-12-28 16:05 ` [PATCH 2/7] batman-adv: fix header alignment by unrolling batadv_header Antonio Quartulli
2013-12-28 16:05 ` [PATCH 4/7] batman-adv: fix size of batadv_bla_claim_dst Antonio Quartulli
[not found] ` <1388246760-3335-1-git-send-email-antonio-x4xJYDvStAgysxA8WJXlww@public.gmane.org>
2013-12-28 16:05 ` [PATCH 1/7] batman-adv: fix alignment for batadv_coded_packet Antonio Quartulli
2013-12-28 16:05 ` [PATCH 3/7] batman-adv: fix size of batadv_icmp_header Antonio Quartulli
2013-12-28 16:05 ` [PATCH 5/7] batman-adv: fix alignment for batadv_tvlv_tt_change Antonio Quartulli
2013-12-28 16:05 ` Antonio Quartulli [this message]
2013-12-28 16:06 ` [PATCH 7/7] batman-adv: fix vlan header access Antonio Quartulli
2013-12-29 5:37 ` pull request [net]: batman-adv 2013-12-28 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1388246760-3335-7-git-send-email-antonio@meshcoding.com \
--to=antonio-x4xjydvstagysxa8wjxlww@public.gmane.org \
--cc=b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=mareklindner-rVWd3aGhH2z5bpWLKbzFeg@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).