diff options
| author | Roy Marples <roy@marples.name> | 2007-07-26 09:35:45 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2007-07-26 09:35:45 +0000 |
| commit | 6d073f75f53e5f1c23248ac12918bed02ae2a1da (patch) | |
| tree | 16fa2755a4600b0dd9dfc236e2b75aeb7448f3a5 /arp.c | |
| parent | 68590c550d1ef7bc3574bda65c57b7ddbb2edcfc (diff) | |
| download | dhcpcd-6d073f75f53e5f1c23248ac12918bed02ae2a1da.tar.xz | |
Fix arp segfaulting and final 3.1.1
Diffstat (limited to 'arp.c')
| -rw-r--r-- | arp.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -196,9 +196,19 @@ int arp_claim (interface_t *iface, struct in_addr address) rp.c = (unsigned char *) ar_spa (reply); rh.c = (unsigned char *) ar_sha (reply); + + /* Ensure the ARP reply is for the address we asked for */ + if (rp.a->s_addr != address.s_addr) + continue; + + /* Some systems send a reply back from our hwaddress - weird */ + if (reply->ar_hln == iface->hwlen && + memcmp (rh.c, iface->hwaddr, iface->hwlen) == 0) + continue; + logger (LOG_ERR, "ARPOP_REPLY received from %s (%s)", inet_ntoa (*rp.a), - hwaddr_ntoa (rh.a, reply->ar_hln)); + hwaddr_ntoa (rh.c, reply->ar_hln)); retval = -1; goto eexit; } |
