2
0

779-net-vxlan-don-t-learn-non-unicast-L2-destinations.patch 1.1 KB

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