Skip to content

Commit 3e798df

Browse files
pflgalak
authored andcommitted
net: ethernet: Send sender IP address in ARP announce packets
In addition to checking that the ARP entry does not exist as the implementation is done currently, also check if the ARP packet is due to IPv4 link local address configuration. In both cases use the provided IPv4 address instead of the one set for the interface. Signed-off-by: Patrik Flykt <[email protected]>
1 parent 7e14cff commit 3e798df

File tree

1 file changed

+3
-3
lines changed
  • subsys/net/l2/ethernet

1 file changed

+3
-3
lines changed

subsys/net/l2/ethernet/arp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,10 @@ static inline struct net_pkt *arp_prepare(struct net_if *iface,
297297
memcpy(hdr->src_hwaddr.addr, net_pkt_lladdr_src(pkt)->addr,
298298
sizeof(struct net_eth_addr));
299299

300-
if (entry) {
301-
my_addr = if_get_addr(entry->iface, current_ip);
302-
} else {
300+
if (!entry || (pkt != NULL && net_pkt_ipv4_auto(pkt))) {
303301
my_addr = current_ip;
302+
} else {
303+
my_addr = if_get_addr(entry->iface, current_ip);
304304
}
305305

306306
if (my_addr) {

0 commit comments

Comments
 (0)