* [PATCH nf-next] netfilter: flowtable: fix set software outdev on top of the net_device_path_stack
@ 2021-03-31 8:53 wenxu
0 siblings, 0 replies; only message in thread
From: wenxu @ 2021-03-31 8:53 UTC (permalink / raw)
To: pablo; +Cc: netfilter-devel
From: wenxu <wenxu@ucloud.cn>
The outdev of nft_forward_info should be set on the top of stack device.
Such the following case:
br0 is a bridge with pvid 100 and veth is in the vlan 100 without untagged
ip l add dev br0 type bridge vlan_filtering 1
brctl addif br0 veth
bridge vlan add dev veth vid 100
bridge vlan add dev br0 vid 100 pvid untagged self
The net device path should be br0-->veth
The software offload doesn't encap the vlan tag and the outdev should
be the top device in the stack(route device).
So thehe outdev for softeware offload should set on br0 but not veth.
Or the vlan didn't tagged outgoing through veth
Fixes: 4cd91f7c290f ("netfilter: flowtable: add vlan support")
Signed-off-by: wenxu <wenxu@ucloud.cn>
---
net/netfilter/nft_flow_offload.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/netfilter/nft_flow_offload.c b/net/netfilter/nft_flow_offload.c
index 4843dd2..53f641b 100644
--- a/net/netfilter/nft_flow_offload.c
+++ b/net/netfilter/nft_flow_offload.c
@@ -119,7 +119,8 @@ static void nft_dev_path_info(const struct net_device_path_stack *stack,
info->indev = NULL;
break;
}
- info->outdev = path->dev;
+ if (!info->outdev)
+ info->outdev = path->dev;
info->encap[info->num_encaps].id = path->encap.id;
info->encap[info->num_encaps].proto = path->encap.proto;
info->num_encaps++;
@@ -129,6 +130,8 @@ static void nft_dev_path_info(const struct net_device_path_stack *stack,
case DEV_PATH_BRIDGE:
if (is_zero_ether_addr(info->h_source))
memcpy(info->h_source, path->dev->dev_addr, ETH_ALEN);
+ if (!info->outdev)
+ info->outdev = path->dev;
switch (path->bridge.vlan_mode) {
case DEV_PATH_BR_VLAN_UNTAG_HW:
--
1.8.3.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-31 8:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-31 8:53 [PATCH nf-next] netfilter: flowtable: fix set software outdev on top of the net_device_path_stack wenxu
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).