mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-30 05:47:45 +00:00
Work around Ultrix gotcha
This commit is contained in:
parent
00294c5604
commit
ac16c3da76
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user