diff --git a/lib/ipv4.c b/lib/ipv4.c
index 715e5450e231ae2c09204f4a890b35c81dfc631b..5fdc73b70584b15b28fed1562039c713206dea01 100644
--- a/lib/ipv4.c
+++ b/lib/ipv4.c
@@ -64,9 +64,9 @@ void ipv4_poll(void)
 	if ((len = ptpd_netif_recvfrom(ipv4_socket, &addr,
 				       buf, sizeof(buf), 0)) > 0) {
 		if (needIP)
-			process_bootp(buf, len - 14);
+			process_bootp(buf, len);
 
-		if (!needIP && (len = process_icmp(buf, len - 14)) > 0)
+		if (!needIP && (len = process_icmp(buf, len)) > 0)
 			ptpd_netif_sendto(ipv4_socket, &addr, buf, len, 0);
 	}