From: Tomek Mrugalski Date: Tue, 10 May 2011 13:07:37 +0000 (+0000) Subject: Relay no longer crashes, when DHCP packet is received over interface without X-Git-Tag: v4_2_2b1~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cdb194b1116016c594a9c3182ae573b922faab09;p=thirdparty%2Fdhcp.git Relay no longer crashes, when DHCP packet is received over interface without any IPv4 address assigned. [ISC-Bugs #22409] --- diff --git a/RELNOTES b/RELNOTES index 0cd11a581..5d2a1e7c3 100644 --- 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 diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c index 325fc9d0b..f21f16f0d 100644 --- a/relay/dhcrelay.c +++ b/relay/dhcrelay.c @@ -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) {