]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix arp segfaulting and final 3.1.1
authorRoy Marples <roy@marples.name>
Thu, 26 Jul 2007 09:35:45 +0000 (09:35 +0000)
committerRoy Marples <roy@marples.name>
Thu, 26 Jul 2007 09:35:45 +0000 (09:35 +0000)
ChangeLog
Makefile
arp.c

index ec94d638a795f4c9cf7ff9b872250add1c3262f4..863b64a9c6e63c3a73698ffaa80100e8e4cf6b58 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-Remove getifaddrs code and instead just use ioctls.
+dhcpcd-3.1.1
+Fix segfault in arp code that some users had.
+Remove getifaddrs code and instead just use ioctls so we don't break
+platforms without getifaddrs as often.
 
 dhcpcd-3.1.0
 Add new socket code to try and support InfiniBand better.
index 9377c600529cfcc07a0dfcc4699bb72d3933959d..9a97fd78e5867252f061e88e2edee6b7a570dec5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION = 3.1.1_pre1
+VERSION = 3.1.1
 CFLAGS ?= -O2 -pipe
 
 # Should work for both GNU make and BSD make
diff --git a/arp.c b/arp.c
index c770e26805915aa3e774a00bfe420ddb04f9dea0..ee2df40e184235b930c54da21b90af063ca3469f 100644 (file)
--- a/arp.c
+++ b/arp.c
@@ -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;
                }