vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| This is one diff that will be followed by others in incremental steps, but first, this needs testing. Does this work on ramdisks? Does this work on your machine in your setup? Because dhclient uses bpf directly to read and write to the network, there is no need to set a 0.0.0.0 address on the interface. It has been observed that in the best case, there are annoying warnings about arp collissions for '0.0.0.0' on the network, this removes that annoyance and potential issue. Please test and feedback. Thanks! Index: dhclient-script ================================================== ================= RCS file: /cvs/src/sbin/dhclient/dhclient-script,v retrieving revision 1.7 diff -u -r1.7 dhclient-script --- dhclient-script 9 Apr 2005 09:14:58 -0000 1.7 +++ dhclient-script 23 May 2005 23:10:42 -0000 @@ -152,13 +152,12 @@ case $reason in MEDIUM) ifconfig $interface $medium - ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1 sleep 1 ;; PREINIT) delete_old_alias - ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 broadcast 255.255.255.255 up + ifconfig $interface up ;; ARPCHECK|ARPSEND) Index: dispatch.c ================================================== ================= RCS file: /cvs/src/sbin/dhclient/dispatch.c,v retrieving revision 1.31 diff -u -r1.31 dispatch.c --- dispatch.c 21 Sep 2004 04:07:03 -0000 1.31 +++ dispatch.c 23 May 2005 23:10:42 -0000 @@ -67,8 +67,8 @@ discover_interfaces(struct interface_info *iface) { struct ifaddrs *ifap, *ifa; - struct sockaddr_in foo; struct ifreq *tif; + int len = IFNAMSIZ + sizeof(struct sockaddr_storage); if (getifaddrs(&ifap) != 0) error("getifaddrs failed"); @@ -82,6 +82,7 @@ if (strcmp(iface->name, ifa->ifa_name)) continue; + /* * If we have the capability, extract link information * and record it in a linked list. @@ -95,24 +96,12 @@ iface->hw_address.htype = HTYPE_ETHER; /* XXX */ memcpy(iface->hw_address.haddr, LLADDR(foo), foo->sdl_alen); - } else if (ifa->ifa_addr->sa_family == AF_INET) { - struct iaddr addr; - - memcpy(&foo, ifa->ifa_addr, sizeof(foo)); - if (foo.sin_addr.s_addr == htonl(INADDR_LOOPBACK)) - continue; - if (!iface->ifp) { - int len = IFNAMSIZ + ifa->ifa_addr->sa_len; - if ((tif = malloc(len)) == NULL) - error("no space to remember ifp"); - strlcpy(tif->ifr_name, ifa->ifa_name, IFNAMSIZ); - memcpy(&tif->ifr_addr, ifa->ifa_addr, - ifa->ifa_addr->sa_len); - iface->ifp = tif; - iface->primary_address = foo.sin_addr; - } - addr.len = 4; - memcpy(addr.iabuf, &foo.sin_addr.s_addr, addr.len); + } + if (!iface->ifp) { + if ((tif = malloc(len)) == NULL) + error("no space to remember ifp"); + strlcpy(tif->ifr_name, ifa->ifa_name, IFNAMSIZ); + iface->ifp = tif; } } -- Todd Fries .. todd@fries.net _____________________________________________ | \ 1.636.410.0632 (voice) | Free Daemon Consulting, LLC \ 1.405.227.9094 (voice) | http://FreeDaemonConsulting.com \ 1.866.792.3418 (FAX) | "..in support of free software solutions." \ 250797 (FWD) | \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 37E7 D3EB 74D0 8D66 A68D B866 0326 204E 3F42 004A http://todd.fries.net/pgp.txt |