From ac16c3da76096d9c21f0888279847d4bef81849c Mon Sep 17 00:00:00 2001 From: Ted Lemon Date: Fri, 9 May 1997 08:07:33 +0000 Subject: [PATCH] Work around Ultrix gotcha --- common/packet.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/packet.c b/common/packet.c index c69cf457..e02a6162 100644 --- a/common/packet.c +++ b/common/packet.c @@ -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;