]> git.ipfire.org Git - thirdparty/dhcp.git/blobdiff - server/bootp.c
- Compliation warnings on GCC 4.3 relating to bootp source address
[thirdparty/dhcp.git] / server / bootp.c
index aff4a33aee6943020f7f1f7abf0af47a1685acac..f3ec1302691198d2e9690b5ae551326aeed84721 100644 (file)
@@ -351,8 +351,14 @@ void bootp (packet)
        hto.hlen = packet -> raw -> hlen + 1;
        memcpy (&hto.hbuf [1], packet -> raw -> chaddr, packet -> raw -> hlen);
 
-       if (packet->interface->address_count)
+       if (packet->interface->address_count) {
                from = packet->interface->addresses[0];
+       } else {
+               log_error("%s: Interface %s appears to have no IPv4 "
+                         "addresses, and so dhcpd cannot select a source "
+                         "address.", msgbuf, packet->interface->name);
+               goto out;
+       }
 
        /* Report what we're doing... */
        log_info ("%s", msgbuf);