]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Work around Ultrix gotcha
authorTed Lemon <source@isc.org>
Fri, 9 May 1997 08:07:33 +0000 (08:07 +0000)
committerTed Lemon <source@isc.org>
Fri, 9 May 1997 08:07:33 +0000 (08:07 +0000)
common/packet.c

index c69cf457567e76f8fc046fada037d2890521e76b..e02a6162db00819ac52cd1bfd55ed839de2278c0 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: packet.c,v 1.16 1997/03/29 03:18:28 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: packet.c,v 1.17 1997/05/09 08:07:33 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -71,7 +71,7 @@ u_int32_t checksum (buf, nbytes, sum)
 #ifdef DEBUG_CHECKSUM_VERBOSE
                debug ("sum = %x", sum);
 #endif
-               sum += (u_int16_t) ntohs(*((u_int16_t *)buf)++);
+               sum += (u_int16_t) ntohs(*((u_int16_t *)(buf + i)));
        }       
 
        /* If there's a single byte left over, checksum it, too.   Network
@@ -80,7 +80,7 @@ u_int32_t checksum (buf, nbytes, sum)
 #ifdef DEBUG_CHECKSUM_VERBOSE
                debug ("sum = %x", sum);
 #endif
-               sum += (*buf) << 8;
+               sum += buf [i] << 8;
        }
        
        return sum;