Skip to content

Commit d043333

Browse files
committed
uip_arp.c - workaround for weird crash on RP2040
in uip_arp_update any attempt to retrieve value from ipaddr location crashes. memcmp works.
1 parent 7809a0f commit d043333

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/utility/uip_arp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@ uip_arp_update(u16_t *ipaddr, struct uip_eth_addr *ethaddr)
170170

171171
/* Check if the source IP address of the incoming packet matches
172172
the IP address in this ARP table entry. */
173-
if(ipaddr[0] == tabptr->ipaddr[0] &&
174-
ipaddr[1] == tabptr->ipaddr[1]) {
173+
if(memcmp(ipaddr, tabptr->ipaddr, 4) == 0) {
175174

176175
/* An old entry found, update this and return. */
177176
memcpy(tabptr->ethaddr.addr, ethaddr->addr, 6);

0 commit comments

Comments
 (0)