151-net-bridge-do-not-send-arp-replies-if-src-and-target.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From: Felix Fietkau <[email protected]>
  2. Date: Thu, 4 Jan 2024 15:21:21 +0100
  3. Subject: [PATCH] net: bridge: do not send arp replies if src and target hw
  4. addr is the same
  5. There are broken devices in the wild that handle duplicate IP address
  6. detection by sending out ARP requests for the IP that they received from a
  7. DHCP server and refuse the address if they get a reply.
  8. When proxyarp is enabled, they would go into a loop of requesting an address
  9. and then NAKing it again.
  10. Link: https://github.com/openwrt/openwrt/issues/14309
  11. Signed-off-by: Felix Fietkau <[email protected]>
  12. ---
  13. --- a/net/bridge/br_arp_nd_proxy.c
  14. +++ b/net/bridge/br_arp_nd_proxy.c
  15. @@ -204,7 +204,10 @@ void br_do_proxy_suppress_arp(struct sk_
  16. if ((p && (p->flags & BR_PROXYARP)) ||
  17. (f->dst && (f->dst->flags & BR_PROXYARP_WIFI)) ||
  18. br_is_neigh_suppress_enabled(f->dst, vid)) {
  19. - if (!vid)
  20. + replied = true;
  21. + if (!memcmp(n->ha, sha, dev->addr_len))
  22. + replied = false;
  23. + else if (!vid)
  24. br_arp_send(br, p, skb->dev, sip, tip,
  25. sha, n->ha, sha, 0, 0);
  26. else
  27. @@ -212,7 +215,6 @@ void br_do_proxy_suppress_arp(struct sk_
  28. sha, n->ha, sha,
  29. skb->vlan_proto,
  30. skb_vlan_tag_get(skb));
  31. - replied = true;
  32. }
  33. /* If we have replied or as long as we know the