dhcpd will discard DHCP request when checksum value of packet is 0xffff.

Yoshihiro takahashi yoshihiro.takahashi at miraclelinux.com
Wed Aug 24 07:54:59 UTC 2011


Hi.

dhcpd will discard DHCP request when checksum value of packet is 0xffff.
0xffff for checksum value is equivalent to 0x0000.
In 0xffff case, is the packet treated as error?

RFC768
------
If the computed checksum  is zero, it is transmitted as all ones
------

dhcp-discover did not work when checksum of packet is 0xffff.
----
52 0.853890 172.18.76.162 172.18.76.161	DHCP DHCP Request - Transaction ID 0x2862
Frame 52 (1514 bytes on wire, 1514 bytes captured)
Ethernet II, Src: ********* (00:40:66:43:99:b2), Dst: ******** (00:07:32:16:47:b0)
Internet Protocol, Src: 172.18.76.162 (172.18.76.162), Dst: 172.18.76.161 (172.18.76.161)
User Datagram Protocol, Src Port: bootps (67), Dst Port: bootps (67)
  Source port: bootps (67)
  Destination port: bootps (67)
  Length: 1480
  Checksum: 0xffff [validation disabled]
Bootstrap Protocol
----


Best regards,

diff -aurp dhcp-4.2.2.orig/common/packet.c dhcp-4.2.2/common/packet.c
--- dhcp-4.2.2.orig/common/packet.c     2011-08-24 13:44:50.251979028 +0900
+++ dhcp-4.2.2/common/packet.c  2011-08-24 14:10:46.688060536 +0900
@@ -322,7 +322,10 @@ decode_udp_ip_header(struct interface_in
                                           8, IPPROTO_UDP + ulen))));

   udp_packets_seen++;
-  if (usum && usum != sum) {
+  /* RFC768
+   * If the computed checksum  is zero, it is transmitted as all ones
+   */
+  if (usum && usum != sum && !(usum == 0xffff && sum == 0)) {
          udp_packets_bad_checksum++;
          if (udp_packets_seen > 4 &&
              (udp_packets_seen / udp_packets_bad_checksum) < 2) {



More information about the dhcp-workers mailing list