Module Name: src Committed By: drochner Date: Wed Feb 16 18:39:34 UTC 2011
Modified Files: src/sys/netipsec: ipsec_input.c xform_ah.c Log Message: remove some unnecessary pointer typecasts (one was wrong on BE systems, but was harmless here because the result is effectively unused) To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/netipsec/ipsec_input.c cvs rdiff -u -r1.28 -r1.29 src/sys/netipsec/xform_ah.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/netipsec/ipsec_input.c diff -u src/sys/netipsec/ipsec_input.c:1.23 src/sys/netipsec/ipsec_input.c:1.24 --- src/sys/netipsec/ipsec_input.c:1.23 Sat Apr 18 14:58:06 2009 +++ src/sys/netipsec/ipsec_input.c Wed Feb 16 18:39:33 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ipsec_input.c,v 1.23 2009/04/18 14:58:06 tsutsui Exp $ */ +/* $NetBSD: ipsec_input.c,v 1.24 2011/02/16 18:39:33 drochner Exp $ */ /* $FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec_input.c,v 1.2.4.2 2003/03/28 20:32:53 sam Exp $ */ /* $OpenBSD: ipsec_input.c,v 1.63 2003/02/20 18:35:43 deraadt Exp $ */ @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ipsec_input.c,v 1.23 2009/04/18 14:58:06 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ipsec_input.c,v 1.24 2011/02/16 18:39:33 drochner Exp $"); /* * IPsec input processing. @@ -606,13 +606,13 @@ ipsec6_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip, int protoff, struct m_tag *mt) { - int prot, af, sproto; + int af, sproto; struct ip6_hdr *ip6; struct m_tag *mtag; struct tdb_ident *tdbi; struct secasindex *saidx; int nxt; - u_int8_t nxt8; + u_int8_t prot, nxt8; int error, nest; IPSEC_ASSERT(m != NULL, ("ipsec6_common_input_cb: null mbuf")); @@ -655,7 +655,7 @@ ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(struct ip6_hdr)); /* Save protocol */ - m_copydata(m, protoff, 1, (unsigned char *) &prot); + m_copydata(m, protoff, 1, &prot); #ifdef INET /* IP-in-IP encapsulation */ Index: src/sys/netipsec/xform_ah.c diff -u src/sys/netipsec/xform_ah.c:1.28 src/sys/netipsec/xform_ah.c:1.29 --- src/sys/netipsec/xform_ah.c:1.28 Mon Feb 14 13:43:45 2011 +++ src/sys/netipsec/xform_ah.c Wed Feb 16 18:39:33 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: xform_ah.c,v 1.28 2011/02/14 13:43:45 drochner Exp $ */ +/* $NetBSD: xform_ah.c,v 1.29 2011/02/16 18:39:33 drochner Exp $ */ /* $FreeBSD: src/sys/netipsec/xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */ /* $OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */ /* @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.28 2011/02/14 13:43:45 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.29 2011/02/16 18:39:33 drochner Exp $"); #include "opt_inet.h" #ifdef __FreeBSD__ @@ -718,7 +718,7 @@ * Save the authenticator, the skipped portion of the packet, * and the AH header. */ - m_copydata(m, 0, skip + rplen + authsize, (char *)(tc+1)); + m_copydata(m, 0, skip + rplen + authsize, (tc + 1)); { u_int8_t *pppp = ((char *)(tc+1))+skip+rplen; @@ -1083,7 +1083,7 @@ ah = (struct newah *)(mtod(mi, char *) + roff); /* Initialize the AH header. */ - m_copydata(m, protoff, sizeof(u_int8_t), (char *) &ah->ah_nxt); + m_copydata(m, protoff, sizeof(u_int8_t), &ah->ah_nxt); ah->ah_len = (rplen + authsize - sizeof(struct ah)) / sizeof(u_int32_t); ah->ah_reserve = 0; ah->ah_spi = sav->spi;