]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcp: Allow for trailing FCS in the packet.
authorRoy Marples <roy@marples.name>
Tue, 15 Oct 2019 10:57:17 +0000 (11:57 +0100)
committerRoy Marples <roy@marples.name>
Tue, 15 Oct 2019 10:57:17 +0000 (11:57 +0100)
src/dhcp.c

index ed0ffa4802bee796dbc1b56fcc614a5edf8af0db..67bf45666ad2c8badd128c8ee34d9ad9b44a7184 100644 (file)
@@ -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. */