summaryrefslogtreecommitdiff
path: root/sys/lib/libsa/in_cksum.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-08-11 06:23:10 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-08-11 06:23:10 +0000
commit16824dd3bbb4d43b141d300c76afbdd0c30fa7b9 (patch)
tree08f2b84878ea46e749b47e3b2953507245ad5384 /sys/lib/libsa/in_cksum.c
parent678b21869f24e6ddc3a341fad1a87c353c5464ca (diff)
ansification and knf and protos
Diffstat (limited to 'sys/lib/libsa/in_cksum.c')
-rw-r--r--sys/lib/libsa/in_cksum.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/lib/libsa/in_cksum.c b/sys/lib/libsa/in_cksum.c
index 928b4fe0e80..f9a12cd8791 100644
--- a/sys/lib/libsa/in_cksum.c
+++ b/sys/lib/libsa/in_cksum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_cksum.c,v 1.2 1996/09/23 14:18:55 mickey Exp $ */
+/* $OpenBSD: in_cksum.c,v 1.3 2003/08/11 06:23:09 deraadt Exp $ */
/* $NetBSD: in_cksum.c,v 1.3 1995/04/22 13:53:48 cgd Exp $ */
/*
@@ -41,6 +41,15 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <netinet/in.h>
+
+#include <netinet/if_ether.h>
+#include <netinet/in_systm.h>
+
+#include "stand.h"
+#include "net.h"
/*
* Checksum routine for Internet Protocol family headers.
@@ -49,12 +58,10 @@
* In particular, it should not be this one.
*/
int
-in_cksum(p, len)
- register void *p;
- register int len;
+in_cksum(void *p, int len)
{
- register int sum = 0, oddbyte = 0, v = 0;
- register u_char *cp = p;
+ int sum = 0, oddbyte = 0, v = 0;
+ u_char *cp = p;
/* we assume < 2^16 bytes being summed */
while (len > 0) {