From: henning Date: Sun, 20 Apr 2014 09:30:56 +0000 (+0000) Subject: nuke in_cksum_addword() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=41c3fefc95b0345e6221331f57ed746950874dcc;p=openbsd nuke in_cksum_addword() don't we all love functions implemented in header files? was under #ifdef _KERNEL at least. incremental checksum updates don't really make sense any more, this is incredibly hard to get right, and doesn't fit the way our kernel deals with the checksums these days. consequently, nothing uses in_cksum_addword any more. was on tech for 3 months, tested by & discussed with many. --- diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 2ebd04af038..ab8b7649bb8 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in.h,v 1.102 2014/01/23 01:10:42 naddy Exp $ */ +/* $OpenBSD: in.h,v 1.103 2014/04/20 09:30:56 henning Exp $ */ /* $NetBSD: in.h,v 1.20 1996/02/13 23:41:47 christos Exp $ */ /* @@ -808,22 +808,6 @@ in_cksum_phdr(u_int32_t src, u_int32_t dst, u_int32_t lenproto) return (sum); } -/* - * in_cksum_addword: - * - * Add the two 16-bit network-order values, carry, and return. - */ -static __inline u_int16_t __attribute__((__unused__)) -in_cksum_addword(u_int16_t a, u_int16_t b) -{ - u_int32_t sum = a + b; - - if (sum > 0xffff) - sum -= 0xffff; - - return (sum); -} - extern int inetctlerrmap[]; extern struct ifqueue ipintrq; /* ip packet input queue */ extern struct in_addr zeroin_addr;