From b6554c2931b1431fb7c1131730eedc7670fc7dfc Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Fri, 13 Feb 2015 21:56:34 -0500 Subject: [PATCH] Quiet the 'UDP length [] does not match header length' message. It is triggered frequently when discarding invalid packets that were received on the DHCP port and it seems to have little significance. --- src/dhcp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/dhcp.c b/src/dhcp.c index 98a2b2a..2f276a1 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -195,11 +195,8 @@ static ssize_t get_raw_packet(struct client_state_t *cs, return -1; } size_t iphdrlen = ntohs(packet.ip.tot_len); - if ((size_t)inc != iphdrlen) { - log_error("%s: UDP length [%zd] does not match header length field [%zu].", - client_config.interface, inc, iphdrlen); + if ((size_t)inc != iphdrlen) return -2; - } if (!cs->using_dhcp_bpf && !get_raw_packet_validate_bpf(&packet)) return -2;