From: Roy Marples Date: Tue, 15 Oct 2019 10:57:17 +0000 (+0100) Subject: dhcp: Allow for trailing FCS in the packet. X-Git-Tag: v8.1.1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9b3ad2c6a80bbdd111a869e3d38e179e8ce4b8e;p=thirdparty%2Fdhcpcd.git dhcp: Allow for trailing FCS in the packet. --- diff --git a/src/dhcp.c b/src/dhcp.c index ed0ffa48..67bf4566 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -3282,7 +3282,7 @@ is_packet_udp_bootp(void *packet, size_t plen) return false; /* Sanity. */ - if (ntohs(ip->ip_len) != plen) + if (ntohs(ip->ip_len) > plen) return false; ip_hlen = (size_t)ip->ip_hl * 4; @@ -3297,7 +3297,7 @@ is_packet_udp_bootp(void *packet, size_t plen) udp = (struct udphdr *)(void *)((char *)ip + ip_hlen); if (ntohs(udp->uh_ulen) < sizeof(*udp)) return false; - if (ip_hlen + ntohs(udp->uh_ulen) != plen) + if (ip_hlen + ntohs(udp->uh_ulen) > plen) return false; /* Check it's to and from the right ports. */