Skip to content

Commit bcfabee

Browse files
committed
netfilter: nft_fwd_netdev: allow to redirect to ifb via ingress
Set skb->tc_redirected to 1, otherwise the ifb driver drops the packet. Set skb->tc_from_ingress to 1 to reinject the packet back to the ingress path after leaving the ifb egress path. This patch inconditionally sets on these two skb fields that are meaningful to the ifb driver. The existing forward action is guaranteed to run from ingress path. Fixes: 39e6dea ("netfilter: nf_tables: add forward expression to the netdev family") Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 76a109f commit bcfabee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/netfilter/nft_fwd_netdev.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ static void nft_fwd_netdev_eval(const struct nft_expr *expr,
2828
struct nft_fwd_netdev *priv = nft_expr_priv(expr);
2929
int oif = regs->data[priv->sreg_dev];
3030

31+
/* These are used by ifb only. */
32+
pkt->skb->tc_redirected = 1;
33+
pkt->skb->tc_from_ingress = 1;
34+
3135
nf_fwd_netdev_egress(pkt, oif);
3236
regs->verdict.code = NF_STOLEN;
3337
}

0 commit comments

Comments
 (0)