summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2006-03-09 09:43:04 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2006-03-09 09:43:04 +0000
commit9d3ca274328d11a6f364b5cea3043f2f2265ba87 (patch)
tree174c171ff1211fe0139e0cf0cf69865e749f2403 /usr.sbin
parentba2b615d13399baefe94e03832845006a617f352 (diff)
in_cksum() should return a u_int16_t and not int. Switch a variable to
unsigned. Found by lint.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ospfd/in_cksum.c7
-rw-r--r--usr.sbin/ospfd/ospfd.h4
2 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/ospfd/in_cksum.c b/usr.sbin/ospfd/in_cksum.c
index e13470f110d..10918c725bc 100644
--- a/usr.sbin/ospfd/in_cksum.c
+++ b/usr.sbin/ospfd/in_cksum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_cksum.c,v 1.2 2005/10/19 15:44:25 stevesk Exp $ */
+/* $OpenBSD: in_cksum.c,v 1.3 2006/03/09 09:43:03 claudio Exp $ */
/* $NetBSD: in_cksum.c,v 1.3 1995/04/22 13:53:48 cgd Exp $ */
/*
@@ -50,10 +50,11 @@
* code and should be modified for each CPU to be as fast as possible.
* In particular, it should not be this one.
*/
-int
+u_int16_t
in_cksum(void *p, int len)
{
- int sum = 0, oddbyte = 0, v = 0;
+ unsigned int sum = 0;
+ int oddbyte = 0, v = 0;
u_char *cp = p;
/* we assume < 2^16 bytes being summed */
diff --git a/usr.sbin/ospfd/ospfd.h b/usr.sbin/ospfd/ospfd.h
index 8196ae1b60a..2fb88807bd0 100644
--- a/usr.sbin/ospfd/ospfd.h
+++ b/usr.sbin/ospfd/ospfd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfd.h,v 1.48 2006/03/09 09:32:37 claudio Exp $ */
+/* $OpenBSD: ospfd.h,v 1.49 2006/03/09 09:43:03 claudio Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -485,7 +485,7 @@ void imsg_free(struct imsg *);
void imsg_event_add(struct imsgbuf *); /* needs to be provided externally */
/* in_cksum.c */
-int in_cksum(void *, int);
+u_int16_t in_cksum(void *, int);
/* iso_cksum.c */
u_int16_t iso_cksum(void *, u_int16_t, u_int16_t);