Skip to contentSkip to conversation

netfilter: bridge: Don't sabotage nf_hook calls for an l3mdev slave

PATCH Applied David Ahern 2 participants 2 messages Feb 26, 2019 – Mar 1, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: bridge: Don't sabotage nf_hook calls for an l3mdev slave

From: David Ahern <[email protected]>

Followup to a173f066c7cf ("netfilter: bridge: Don't sabotage nf_hook calls from an l3mdev"). Some packets (e.g., ndisc) do not have the skb device flipped to the l3mdev (e.g., VRF) device. Update ip_sabotage_in to not drop packets for slave devices too. Currently, neighbor solicitation packets for 'dev -> bridge (addr) -> vrf' setups are getting dropped. This patch enables IPv6 communications for bridges with an address that are enslaved to a VRF.

Fixes 73e20b761acf ("net: vrf: Add support for PREROUTING rules on vrf device")
---
 net/bridge/br_netfilter_hooks.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/bridge/br_netfilter_hooks.c +2 -1
index c93c35bb73dd..8ab222babc98 100644
@@ -831,7 +831,8 @@ static unsigned int ip_sabotage_in(void *priv,
 	struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
 
 	if (nf_bridge && !nf_bridge->in_prerouting &&
-	    !netif_is_l3_master(skb->dev)) {
+	    !netif_is_l3_master(skb->dev) &&
+	    !netif_is_l3_slave(skb->dev)) {
 		state->okfn(state->net, state->sk, skb);
 		return NF_STOLEN;
 	}
Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw
Quoted 9 lines · David Ahern

From: David Ahern <[email protected]>

Followup to a173f066c7cf ("netfilter: bridge: Don't sabotage nf_hook calls from an l3mdev"). Some packets (e.g., ndisc) do not have the skb device flipped to the l3mdev (e.g., VRF) device. Update ip_sabotage_in to not drop packets for slave devices too. Currently, neighbor solicitation packets for 'dev -> bridge (addr) -> vrf' setups are getting dropped. This patch enables IPv6 communications for bridges with an address that are enslaved to a VRF.

Applied.