Page MenuHomeFreeBSD

D38908.diff
No OneTemporary

D38908.diff

diff --git a/sbin/dhclient/dhclient-script b/sbin/dhclient/dhclient-script
--- a/sbin/dhclient/dhclient-script
+++ b/sbin/dhclient/dhclient-script
@@ -318,13 +318,12 @@
case $reason in
MEDIUM)
eval "$IFCONFIG $interface $medium"
- eval "$IFCONFIG $interface inet -alias 0.0.0.0 $medium" >/dev/null 2>&1
sleep 1
;;
PREINIT)
delete_old_alias
- $IFCONFIG $interface inet alias 0.0.0.0 netmask 255.0.0.0 broadcast 255.255.255.255 up
+ eval "$IFCONFIG $interface up"
;;
ARPCHECK|ARPSEND)
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c
--- a/sbin/dhclient/dispatch.c
+++ b/sbin/dhclient/dispatch.c
@@ -78,6 +78,7 @@
{
struct ifaddrs *ifap, *ifa;
struct ifreq *tif;
+ int len = IFNAMSIZ + sizeof(struct sockaddr_storage);
if (getifaddrs(&ifap) != 0)
error("getifaddrs failed");
@@ -118,26 +119,14 @@
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 sockaddr_in foo;
- struct iaddr addr;
-
- memcpy(&foo, ifa->ifa_addr, sizeof(foo));
- if (foo.sin_addr.s_addr == htonl(INADDR_LOOPBACK))
- continue;
- if (!iface->ifp) {
- if ((tif = calloc(1, sizeof(struct ifreq)))
- == 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 = calloc(1, len)) == NULL)
+ error("no space to remember ifp");
+ strlcpy(tif->ifr_name, ifa->ifa_name, IFNAMSIZ);
+ iface->ifp = tif;
+ }
+
}
if (!iface->ifp)

File Metadata

Mime Type
text/plain
Expires
Sun, Jun 21, 2:50 PM (12 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34151761
Default Alt Text
D38908.diff (1 KB)

Event Timeline