From 9d3ca274328d11a6f364b5cea3043f2f2265ba87 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Thu, 9 Mar 2006 09:43:04 +0000 Subject: in_cksum() should return a u_int16_t and not int. Switch a variable to unsigned. Found by lint. --- usr.sbin/ospfd/in_cksum.c | 7 ++++--- usr.sbin/ospfd/ospfd.h | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'usr.sbin') 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 @@ -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); -- cgit v1.2.3