-/* $OpenBSD: dhcpd.h,v 1.61 2017/04/13 14:59:40 krw Exp $ */
+/* $OpenBSD: dhcpd.h,v 1.62 2017/04/17 18:31:08 krw Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998, 1999
int, struct hardware *);
ssize_t decode_udp_ip_header(struct interface_info *, unsigned char *,
int, struct sockaddr_in *, int);
-u_int32_t checksum(unsigned char *, unsigned, u_int32_t);
+u_int32_t checksum(unsigned char *, u_int32_t, u_int32_t);
u_int32_t wrapsum(u_int32_t);
/* icmp.c */
-/* $OpenBSD: packet.c,v 1.12 2017/02/13 19:13:14 krw Exp $ */
+/* $OpenBSD: packet.c,v 1.13 2017/04/17 18:31:08 krw Exp $ */
/* Packet assembly code, originally contributed by Archie Cobbs. */
#include "dhcpd.h"
#include "log.h"
-u_int32_t checksum(unsigned char *, unsigned, u_int32_t);
-u_int32_t wrapsum(u_int32_t);
-
u_int32_t
-checksum(unsigned char *buf, unsigned nbytes, u_int32_t sum)
+checksum(unsigned char *buf, u_int32_t nbytes, u_int32_t sum)
{
- int i;
+ unsigned int i;
/* Checksum all the pairs of bytes first... */
for (i = 0; i < (nbytes & ~1U); i += 2) {