netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] netfilter: bridge: refactor clearing BRNF_NF_BRIDGE_PREROUTING
@ 2015-05-30 13:26 Bernhard Thaler
  2015-06-12 12:25 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Bernhard Thaler @ 2015-05-30 13:26 UTC (permalink / raw)
  To: pablo, kadlec; +Cc: netfilter-devel, fw, Bernhard Thaler

use binary AND on complement of BRNF_NF_BRIDGE_PREROUTING to unset
bit in nf_bridge->mask.

Signed-off-by: Bernhard Thaler <bernhard.thaler@wvnet.at>
---
 net/bridge/br_netfilter.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 46660a2..2651876 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -290,7 +290,7 @@ static int br_nf_pre_routing_finish_ipv6(struct sock *sk, struct sk_buff *skb)
 		skb->pkt_type = PACKET_OTHERHOST;
 		nf_bridge->pkt_otherhost = false;
 	}
-	nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
+	nf_bridge->mask &= ~BRNF_NF_BRIDGE_PREROUTING;
 
 	rt = bridge_parent_rtable(nf_bridge->physindev);
 	if (!rt) {
@@ -415,7 +415,7 @@ static int br_nf_pre_routing_finish(struct sock *sk, struct sk_buff *skb)
 		skb->pkt_type = PACKET_OTHERHOST;
 		nf_bridge->pkt_otherhost = false;
 	}
-	nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
+	nf_bridge->mask &= ~BRNF_NF_BRIDGE_PREROUTING;
 	if (daddr_was_changed(skb, nf_bridge)) {
 		if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))) {
 			struct in_device *in_dev = __in_dev_get_rcu(dev);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/3] netfilter: bridge: refactor clearing BRNF_NF_BRIDGE_PREROUTING
  2015-05-30 13:26 [PATCH 1/3] netfilter: bridge: refactor clearing BRNF_NF_BRIDGE_PREROUTING Bernhard Thaler
@ 2015-06-12 12:25 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2015-06-12 12:25 UTC (permalink / raw)
  To: Bernhard Thaler; +Cc: kadlec, netfilter-devel, fw

On Sat, May 30, 2015 at 03:26:13PM +0200, Bernhard Thaler wrote:
> use binary AND on complement of BRNF_NF_BRIDGE_PREROUTING to unset
> bit in nf_bridge->mask.

Applied, thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-12 12:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-30 13:26 [PATCH 1/3] netfilter: bridge: refactor clearing BRNF_NF_BRIDGE_PREROUTING Bernhard Thaler
2015-06-12 12:25 ` Pablo Neira Ayuso

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).