3 @@ -147,7 +147,7 @@ void dhcp_packet(time_t now, int pxe_fd)
5 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 @@ -277,11 +277,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 @@ -300,7 +298,7 @@ void dhcp_packet(time_t now, int pxe_fd)
27 parm.relay_local.s_addr = 0;
28 parm.ind = iface_index;
30 - if (!iface_check(AF_INET, (struct all_addr *)&iface_addr, ifr.ifr_name, NULL))
31 + if (!iface_check(AF_INET, (struct all_addr *)addrp, ifr.ifr_name, NULL))
33 /* If we failed to match the primary address of the interface, see if we've got a --listen-address
35 @@ -320,6 +318,12 @@ void dhcp_packet(time_t now, int pxe_fd)
36 complete_context(match.addr, iface_index, NULL, match.netmask, match.broadcast, &parm);
41 + my_syslog(MS_DHCP | LOG_WARNING, _("DHCP packet received on %s which has no address"), ifr.ifr_name);
45 if (!iface_enumerate(AF_INET, &parm, complete_context))