Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netipsec remove some unnecessary pointer typecasts
details: https://anonhg.NetBSD.org/src/rev/55bb3cd22e5c
branches: trunk
changeset: 762142:55bb3cd22e5c
user: drochner <drochner%NetBSD.org@localhost>
date: Wed Feb 16 18:39:33 2011 +0000
description:
remove some unnecessary pointer typecasts
(one was wrong on BE systems, but was harmless here because the
result is effectively unused)
diffstat:
sys/netipsec/ipsec_input.c | 10 +++++-----
sys/netipsec/xform_ah.c | 8 ++++----
2 files changed, 9 insertions(+), 9 deletions(-)
diffs (79 lines):
diff -r b09353755395 -r 55bb3cd22e5c sys/netipsec/ipsec_input.c
--- a/sys/netipsec/ipsec_input.c Wed Feb 16 18:39:26 2011 +0000
+++ b/sys/netipsec/ipsec_input.c Wed Feb 16 18:39:33 2011 +0000
@@ -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 */
diff -r b09353755395 -r 55bb3cd22e5c sys/netipsec/xform_ah.c
--- a/sys/netipsec/xform_ah.c Wed Feb 16 18:39:26 2011 +0000
+++ b/sys/netipsec/xform_ah.c Wed Feb 16 18:39:33 2011 +0000
@@ -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;
Home |
Main Index |
Thread Index |
Old Index