]> 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 13:07:37 +0000 (13:07 +0000)
committerTomek Mrugalski <tomek@isc.org>
Tue, 10 May 2011 13:07:37 +0000 (13:07 +0000)
any IPv4 address assigned. [ISC-Bugs #22409]

RELNOTES
relay/dhcrelay.c

index 0cd11a58170efb38041ba517a2888b6d78873d97..5d2a1e7c3f56dc0760a4057f1d0e4ece8d2e9bcc 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -277,6 +277,9 @@ work on other platforms. Please report any problems and suggested fixes to
   crashing on an assert failure.  Also retag the lease as active
   and reset it's timeout value.
   [ISC-Bugs #21921]
+
+- Relay no longer crashes, when DHCP packet is received over interface without
+  any IPv4 address assigned. [ISC-Bugs #22409]
  
                        Changes since 4.2.0rc1
 
index 325fc9d0b60b3ee31cedc25e14e97e8269093777..f21f16f0d451d42f219f1c979001cb8f8e98eb89 100644 (file)
@@ -594,6 +594,12 @@ do_relay4(struct interface_info *ip, struct dhcp_packet *packet,
                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;
+       }
+
        /* Find the interface that corresponds to the giaddr
           in the packet. */
        if (packet->giaddr.s_addr) {