mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-30 13:57:50 +00:00
Work around Ultrix gotcha
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
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 */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -71,7 +71,7 @@ u_int32_t checksum (buf, nbytes, sum)
|
|||||||
#ifdef DEBUG_CHECKSUM_VERBOSE
|
#ifdef DEBUG_CHECKSUM_VERBOSE
|
||||||
debug ("sum = %x", sum);
|
debug ("sum = %x", sum);
|
||||||
#endif
|
#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
|
/* 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
|
#ifdef DEBUG_CHECKSUM_VERBOSE
|
||||||
debug ("sum = %x", sum);
|
debug ("sum = %x", sum);
|
||||||
#endif
|
#endif
|
||||||
sum += (*buf) << 8;
|
sum += buf [i] << 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
return sum;
|
return sum;
|
||||||
|
Reference in New Issue
Block a user