kernel: add pending patches for new LED_FUNCTION_* definitions
[openwrt/openwrt.git] / target / linux / generic / pending-5.15 / 779-net-vxlan-don-t-learn-non-unicast-L2-destinations.patch
1 From 3f1a227cb071f65f6ecc4db9f399649869735a7c Mon Sep 17 00:00:00 2001
2 From: David Bauer <mail@david-bauer.net>
3 Date: Sat, 17 Feb 2024 22:34:59 +0100
4 Subject: [PATCH] net vxlan: don't learn non-unicast L2 destinations
5
6 This patch avoids learning non-unicast targets in the vxlan FDB.
7 They are non-unicast and thus should be sent to the broadcast-IPv6
8 instead of a unicast address.
9
10 Link: https://lore.kernel.org/netdev/15ee0cc7-9252-466b-8ce7-5225d605dde8@david-bauer.net/
11 Link: https://github.com/freifunk-gluon/gluon/issues/3191
12
13 Signed-off-by: David Bauer <mail@david-bauer.net>
14 ---
15 drivers/net/vxlan.c | 4 ++++
16 1 file changed, 4 insertions(+)
17
18 --- a/drivers/net/vxlan/vxlan_core.c
19 +++ b/drivers/net/vxlan/vxlan_core.c
20 @@ -1493,6 +1493,10 @@ static bool vxlan_snoop(struct net_devic
21 struct vxlan_fdb *f;
22 u32 ifindex = 0;
23
24 + /* Don't learn broadcast packets */
25 + if (is_multicast_ether_addr(src_mac) || is_zero_ether_addr(src_mac))
26 + return false;
27 +
28 #if IS_ENABLED(CONFIG_IPV6)
29 if (src_ip->sa.sa_family == AF_INET6 &&
30 (ipv6_addr_type(&src_ip->sin6.sin6_addr) & IPV6_ADDR_LINKLOCAL))