linux-stable/net/bridge
Florian Westphal 271bf4601e netfilter: bridge: add support for pppoe filtering
[ Upstream commit 28b78ecffe ]

This makes 'bridge-nf-filter-pppoe-tagged' sysctl work for
bridged traffic.

Looking at the original commit it doesn't appear this ever worked:

 static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff **pskb,
[..]
        if (skb->protocol == htons(ETH_P_8021Q)) {
                skb_pull(skb, VLAN_HLEN);
                skb->network_header += VLAN_HLEN;
+       } else if (skb->protocol == htons(ETH_P_PPP_SES)) {
+               skb_pull(skb, PPPOE_SES_HLEN);
+               skb->network_header += PPPOE_SES_HLEN;
        }
 [..]
	NF_HOOK(... POST_ROUTING, ...)

... but the adjusted offsets are never restored.

The alternative would be to rip this code out for good,
but otoh we'd have to keep this anyway for the vlan handling
(which works because vlan tag info is in the skb, not the packet
 payload).

Reported-and-tested-by: Amish Chana <amish@3g.co.za>
Fixes: 516299d2f5 ("[NETFILTER]: bridge-nf: filter bridged IPv4/IPv6 encapsulated in pppoe traffic")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-01-27 09:00:49 +01:00
..
netfilter netfilter: nft_reject_bridge: enable reject with bridge vlan 2020-06-03 08:18:08 +02:00
br.c net: bridge: Receive notification about successful FDB offload 2017-06-08 14:16:25 -04:00
br_device.c net: bridge: add missing counters to ndo_get_stats64 callback 2020-11-24 13:05:38 +01:00
br_fdb.c bridge: add tracepoint in br_fdb_update 2017-08-31 11:42:41 -07:00
br_forward.c net: bridge: Fix ethernet header pointer before check skb forwardable 2019-01-31 08:13:41 +01:00
br_if.c net: bridge: fix memleak in br_add_if() 2021-08-26 08:37:02 -04:00
br_input.c net: bridge: fix per-port af_packet sockets 2019-04-27 09:35:33 +02:00
br_ioctl.c bridge: move to workqueue gc 2017-02-06 22:53:13 -05:00
br_mdb.c bridge/mdb: remove wrong use of NLM_F_MULTI 2019-09-19 09:07:59 +02:00
br_multicast.c net: bridge: multicast: fix PIM hello router port marking race 2021-07-20 16:17:55 +02:00
br_netfilter_hooks.c netfilter: bridge: add support for pppoe filtering 2022-01-27 09:00:49 +01:00
br_netfilter_ipv6.c netfilter: bridge: set skb transport_header before entering NF_INET_PRE_ROUTING 2019-05-04 09:15:18 +02:00
br_netlink.c net: bridge: use nla_total_size_64bit() in br_get_linkxstats_size() 2021-10-17 10:08:33 +02:00
br_netlink_tunnel.c netlink: pass extended ACK struct to parsing functions 2017-04-13 13:58:22 -04:00
br_nf_core.c net: add bool confirm_neigh parameter for dst_ops.update_pmtu 2020-01-04 14:00:14 +01:00
br_private.h net: bridge: fix vlan tunnel dst null pointer dereference 2021-06-30 08:48:54 -04:00
br_private_stp.h
br_private_tunnel.h bridge: vlan dst_metadata hooks in ingress and egress paths 2017-02-03 15:21:22 -05:00
br_stp.c bridge: move to workqueue gc 2017-02-06 22:53:13 -05:00
br_stp_bpdu.c net: bridge: stp: don't cache eth dest pointer before skb pull 2019-07-31 07:28:46 +02:00
br_stp_if.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-06 22:20:08 -04:00
br_stp_timer.c bridge: start hello_timer when enabling KERNEL_STP in br_stp_start 2017-05-21 13:33:28 -04:00
br_switchdev.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
br_sysfs_br.c net: bridge: constify attribute_group structures. 2017-06-29 15:48:52 -04:00
br_sysfs_if.c net: bridge: use switchdev for port flags set through sysfs too 2021-03-07 11:27:43 +01:00
br_vlan.c net: bridge: vlan: fix error return code in __vlan_add() 2020-12-29 13:46:45 +01:00
br_vlan_tunnel.c net: bridge: fix vlan tunnel dst refcnt when egressing 2021-06-30 08:48:54 -04:00
Kconfig
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00