@@ -172,6 +172,7 @@ struct nf_flow_route {
u32 ifindex;
u8 h_source[ETH_ALEN];
u8 h_dest[ETH_ALEN];
+ enum flow_offload_xmit_type xmit_type;
} out;
struct dst_entry *dst;
} tuple[FLOW_OFFLOAD_DIR_MAX];
@@ -100,6 +100,10 @@ static int flow_offload_fill_route(struct flow_offload *flow,
if (dst_xfrm(dst))
flow_tuple->xmit_type = FLOW_OFFLOAD_XMIT_XFRM;
+ else
+ flow_tuple->xmit_type = route->tuple[dir].out.xmit_type;
+
+ flow_tuple->dst_cache = dst;
flow_tuple->dst_cache = dst;
@@ -54,6 +54,7 @@ struct nft_forward_info {
u32 iifindex;
u8 h_source[ETH_ALEN];
u8 h_dest[ETH_ALEN];
+ enum flow_offload_xmit_type xmit_type;
};
static int nft_dev_forward_path(struct nf_flow_route *route,
@@ -83,7 +84,9 @@ static int nft_dev_forward_path(struct nf_flow_route *route,
case DEV_PATH_VLAN:
return -1;
case DEV_PATH_BRIDGE:
- return -1;
+ memcpy(info.h_dest, path->dev->dev_addr, ETH_ALEN);
+ info.xmit_type = FLOW_OFFLOAD_XMIT_DIRECT;
+ break;
}
}
@@ -91,6 +94,7 @@ static int nft_dev_forward_path(struct nf_flow_route *route,
memcpy(route->tuple[dir].out.h_dest, info.h_source, ETH_ALEN);
memcpy(route->tuple[dir].out.h_source, info.h_dest, ETH_ALEN);
route->tuple[dir].out.ifindex = info.iifindex;
+ route->tuple[dir].out.xmit_type = info.xmit_type;
return 0;
}
Update hardware destination address to the master bridge device to emulate the forwarding behaviour. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> --- include/net/netfilter/nf_flow_table.h | 1 + net/netfilter/nf_flow_table_core.c | 4 ++++ net/netfilter/nft_flow_offload.c | 6 +++++- 3 files changed, 10 insertions(+), 1 deletion(-)