af_packet: Introduce egress hook
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 8 Oct 2021 20:06:04 +0000 (22:06 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 14 Oct 2021 21:06:44 +0000 (23:06 +0200)
commit0d7308c0ff5fa7c77164ab8491a91e0589da66e3
treef2109eb0066f5fffae3ef82b5f9cb175df338c3e
parent42df6e1d221dddc0f2acf2be37e68d553ad65f96
af_packet: Introduce egress hook

Add egress hook for AF_PACKET sockets that have the PACKET_QDISC_BYPASS
socket option set to on, which allows packets to escape without being
filtered in the egress path.

This patch only updates the AF_PACKET path, it does not update
dev_direct_xmit() so the XDP infrastructure has a chance to bypass
Netfilter.

[lukas: acquire rcu_read_lock, fix typos, rebase]
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/packet/af_packet.c