3 @@ -134,7 +134,7 @@ void dhcp_packet(time_t now, int pxe_fd)
6 int iface_index = 0, unicast_dest = 0, is_inform = 0;
7 - struct in_addr iface_addr;
8 + struct in_addr iface_addr, *addrp = NULL;
9 struct iface_param parm;
10 #ifdef HAVE_LINUX_NETWORK
11 struct arpreq arp_req;
12 @@ -246,11 +246,9 @@ void dhcp_packet(time_t now, int pxe_fd)
14 ifr.ifr_addr.sa_family = AF_INET;
15 if (ioctl(daemon->dhcpfd, SIOCGIFADDR, &ifr) != -1 )
16 - iface_addr = ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr;
19 - my_syslog(MS_DHCP | LOG_WARNING, _("DHCP packet received on %s which has no address"), ifr.ifr_name);
21 + addrp = &iface_addr;
22 + iface_addr = ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr;
25 for (tmp = daemon->dhcp_except; tmp; tmp = tmp->next)
26 @@ -272,7 +270,7 @@ void dhcp_packet(time_t now, int pxe_fd)
28 parm.ind = iface_index;
30 - if (!iface_check(AF_INET, (struct all_addr *)&iface_addr, ifr.ifr_name))
31 + if (!iface_check(AF_INET, (struct all_addr *)addrp, ifr.ifr_name))
33 /* If we failed to match the primary address of the interface, see if we've got a --listen-address
35 @@ -291,7 +289,13 @@ void dhcp_packet(time_t now, int pxe_fd)
36 there is more than one address on the interface in the same subnet */
37 complete_context(match.addr, iface_index, match.netmask, match.broadcast, &parm);
43 + my_syslog(MS_DHCP | LOG_WARNING, _("DHCP packet received on %s which has no address"), ifr.ifr_name);
47 if (!iface_enumerate(AF_INET, &parm, complete_context))