From f9b3ad2c6a80bbdd111a869e3d38e179e8ce4b8e Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 15 Oct 2019 11:57:17 +0100 Subject: [PATCH] dhcp: Allow for trailing FCS in the packet. --- src/dhcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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. */ -- 2.47.2