Skip to content

Commit

Permalink
net: bridge: do not send arp replies if src and target hw addr is the…
Browse files Browse the repository at this point in the history
… same

There are broken devices in the wild that handle duplicate IP address
detection by sending out ARP requests for the IP that they received from a
DHCP server and refuse the address if they get a reply.
When proxyarp is enabled, they would go into a loop of requesting an address
and then NAKing it again.

Link: openwrt/openwrt#14309
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: NipaLocal <nipa@local>
  • Loading branch information
nbd168 authored and NipaLocal committed Jan 9, 2024
1 parent c5b428d commit 3a00afd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/bridge/br_arp_nd_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,17 @@ void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br,
if ((p && (p->flags & BR_PROXYARP)) ||
(f->dst && (f->dst->flags & BR_PROXYARP_WIFI)) ||
br_is_neigh_suppress_enabled(f->dst, vid)) {
if (!vid)
replied = true;
if (!memcmp(n->ha, sha, dev->addr_len))
replied = false;
else if (!vid)
br_arp_send(br, p, skb->dev, sip, tip,
sha, n->ha, sha, 0, 0);
else
br_arp_send(br, p, skb->dev, sip, tip,
sha, n->ha, sha,
skb->vlan_proto,
skb_vlan_tag_get(skb));
replied = true;
}

/* If we have replied or as long as we know the
Expand Down

0 comments on commit 3a00afd

Please sign in to comment.