#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"
#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
#ifdef DEBUG_CHECKSUM_VERBOSE
debug ("sum = %x", sum);
#endif
- sum += (*buf) << 8;
+ sum += buf [i] << 8;
}
return sum;