]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Relay no longer crashes, when DHCP packet is received over interface without
authorTomek Mrugalski <tomek@isc.org>
Tue, 10 May 2011 11:24:44 +0000 (11:24 +0000)
committerTomek Mrugalski <tomek@isc.org>
Tue, 10 May 2011 11:24:44 +0000 (11:24 +0000)
any IPv4 address assigned. Also extended logging message about discarding
packets with invalid hlen with information about relevant interface name.
[ISC-Bugs #22409]

RELNOTES
relay/dhcrelay.c

index 56ea49c8ddeffb8c263b48b845ac7847787e0ee9..98fd08a85df4a939e03d03685838945bf9025389 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -112,6 +112,11 @@ work on other platforms. Please report any problems and suggested fixes to
   [ISC-Bugs #19615] update the includes in dhcpctl/dhcpctl.3 to be more correct
   [ISC-Bugs #20676] update dhcpd.conf.5 to include the RFC numbers for DDNS
 
+- Relay no longer crashes, when DHCP packet is received over interface without
+  any IPv4 address assigned. Also extended logging message about discarding
+  packets with invalid hlen with information about relevant interface name.
+  [ISC-Bugs #22409]
+
                        Changes since 4.2.0
 
 - Documentation cleanup covering multiple tickets
index 62689fbccd0e551609a3a984f6f90785ddd06864..2e42b5e5340f29bae82a3b0b1d277592c5f60e65 100644 (file)
@@ -590,7 +590,13 @@ do_relay4(struct interface_info *ip, struct dhcp_packet *packet,
        struct hardware hto, *htop;
 
        if (packet->hlen > sizeof packet->chaddr) {
-               log_info("Discarding packet with invalid hlen.");
+               log_info("Discarding packet with invalid hlen, received on "
+                        "%s interface.", ip->name);
+               return;
+       }
+       if (ip->address_count < 1 || ip->addresses == NULL) {
+               log_info("Discarding packet received on %s interface that "
+                        "has no IPv4 address assigned.", ip->name);
                return;
        }
 
@@ -1293,7 +1299,7 @@ setup_streams(void) {
                                break;
                }
                if (i == dp->ifp->v6address_count)
-                       log_fatal("Can't find link address for interface '%s'.",
+                       log_fatal("Interface %s does not have global IPv6 address assigned.",
                                  dp->ifp->name);
                if (!link_is_set)
                        memcpy(&dp->link.sin6_addr,