--- dhcpcd-1.3.22pl4/udpipgen.c-o	2006-01-31 12:48:48.000000000 +0100
+++ dhcpcd-1.3.22pl4/udpipgen.c	2006-01-31 12:52:37.000000000 +0100
@@ -103,9 +103,9 @@
   struct udphdr *udp=(struct udphdr *)udpip->udp;
   udpiphdr *nudpip = udpip;
 
-  hl = ip->ip_hl<<2;
-  if ( in_cksum((unsigned short *)udpip,hl) ) return -1;
   memcpy(&save_ip, udpip->ip, sizeof(struct ip));
+  hl = save_ip.ip_hl<<2;
+  if ( in_cksum((unsigned short *)udpip,hl) ) return -1;
   hl -= sizeof(struct ip);
   if ( hl )
     { /* thrash IP options */
