Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netipsec Fix whitespace (mostly removing trailing).
details: https://anonhg.NetBSD.org/src/rev/3deecea1adef
branches: trunk
changeset: 781660:3deecea1adef
user: gdt <gdt%NetBSD.org@localhost>
date: Thu Sep 20 23:50:05 2012 +0000
description:
Fix whitespace (mostly removing trailing).
This commit changes only whitespace (trailing, tabs vs spaces,
removing spurious newlines). From Bev Schwartz of BBN.
diffstat:
sys/netipsec/key.c | 61 ++++++++++++++++++++++++++---------------------------
1 files changed, 30 insertions(+), 31 deletions(-)
diffs (238 lines):
diff -r 3b87384bf1f1 -r 3deecea1adef sys/netipsec/key.c
--- a/sys/netipsec/key.c Thu Sep 20 21:16:48 2012 +0000
+++ b/sys/netipsec/key.c Thu Sep 20 23:50:05 2012 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: key.c,v 1.78 2012/08/30 12:16:49 drochner Exp $ */
+/* $NetBSD: key.c,v 1.79 2012/09/20 23:50:05 gdt Exp $ */
/* $FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $ */
/* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */
-
+
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.78 2012/08/30 12:16:49 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.79 2012/09/20 23:50:05 gdt Exp $");
/*
* This code is referd to RFC 2367
@@ -360,10 +360,10 @@
* set parameters into secasindex buffer.
* Must allocate secasindex buffer before calling this function.
*/
-static int
-key_setsecasidx (int, int, int, const struct sadb_address *,
+static int
+key_setsecasidx (int, int, int, const struct sadb_address *,
const struct sadb_address *, struct secasindex *);
-
+
/* key statistics */
struct _keystat {
u_long getspi_count; /* the avarage of count to try to get new SPI */
@@ -466,7 +466,7 @@
static u_int32_t key_do_getnewspi (const struct sadb_spirange *,
const struct secasindex *);
#ifdef IPSEC_NAT_T
-static int key_handle_natt_info (struct secasvar *,
+static int key_handle_natt_info (struct secasvar *,
const struct sadb_msghdr *);
static int key_set_natt_ports (union sockaddr_union *,
union sockaddr_union *,
@@ -997,7 +997,7 @@
("key_do_allocsa_policy: bogus ref count"));
satype = key_proto2satype(d->sah->saidx.proto);
- if (satype == 0)
+ if (satype == 0)
goto msgfail;
m = key_setsadbmsg(SADB_DELETE, 0,
@@ -1113,13 +1113,13 @@
printf("DP key_allocsa from %s:%u\n", where, tag));
/*
- * XXX IPCOMP case
+ * XXX IPCOMP case
* We use cpi to define spi here. In the case where cpi <=
* IPCOMP_CPI_NEGOTIATE_MIN, cpi just define the algorithm used, not
* the real spi. In this case, don't check the spi but check the
* algorithm
*/
-
+
if (proto == IPPROTO_IPCOMP) {
u_int32_t tmp;
tmp = ntohl(spi);
@@ -1166,7 +1166,7 @@
#if 0 /* don't check src */
/* Fix port in src->sa */
-
+
/* check src address */
if (key_sockaddrcmp(&src->sa, &sav->sah->saidx.src.sa, 0) != 0)
continue;
@@ -1810,7 +1810,7 @@
* m will always be freed.
*/
static int
-key_spdadd(struct socket *so, struct mbuf *m,
+key_spdadd(struct socket *so, struct mbuf *m,
const struct sadb_msghdr *mhp)
{
const struct sadb_address *src0, *dst0;
@@ -2439,8 +2439,8 @@
return key_sendup_mbuf(so, m, KEY_SENDUP_ALL);
}
-static struct sockaddr key_src = {
- .sa_len = 2,
+static struct sockaddr key_src = {
+ .sa_len = 2,
.sa_family = PF_KEY,
};
@@ -3602,7 +3602,7 @@
case SADB_X_EXT_NAT_T_TYPE:
m = key_setsadbxtype(sav->natt_type);
break;
-
+
case SADB_X_EXT_NAT_T_DPORT:
if (sav->natt_type == 0)
continue;
@@ -3774,10 +3774,10 @@
return m;
}
-/*
+/*
* Get port from sockaddr, port is in network order
*/
-u_int16_t
+u_int16_t
key_portfromsaddr(const union sockaddr_union *saddr)
{
u_int16_t port;
@@ -3822,7 +3822,7 @@
}
#endif
default:
- printf("key_porttosaddr: unexpected address family %d\n",
+ printf("key_porttosaddr: unexpected address family %d\n",
saddr->sa.sa_family);
break;
}
@@ -3831,7 +3831,7 @@
}
/*
- * Safety check sa_len
+ * Safety check sa_len
*/
static int
key_checksalen(const union sockaddr_union *saddr)
@@ -4822,23 +4822,23 @@
/* NOTREACHED */
}
-static int
+static int
key_setsecasidx(int proto, int mode, int reqid,
const struct sadb_address * src,
const struct sadb_address * dst,
struct secasindex * saidx)
{
- const union sockaddr_union * src_u =
+ const union sockaddr_union * src_u =
(const union sockaddr_union *) src;
const union sockaddr_union * dst_u =
- (const union sockaddr_union *) dst;
+ (const union sockaddr_union *) dst;
/* sa len safety check */
if (key_checksalen(src_u) != 0)
return -1;
if (key_checksalen(dst_u) != 0)
return -1;
-
+
memset(saidx, 0, sizeof(*saidx));
saidx->proto = proto;
saidx->mode = mode;
@@ -4847,7 +4847,7 @@
memcpy(&saidx->dst, dst_u, dst_u->sa.sa_len);
#ifndef IPSEC_NAT_T
- key_porttosaddr(&((saidx)->src),0);
+ key_porttosaddr(&((saidx)->src),0);
key_porttosaddr(&((saidx)->dst),0);
#endif
return 0;
@@ -4912,7 +4912,7 @@
}
- if ((error = key_setsecasidx(proto, mode, reqid, src0 + 1,
+ if ((error = key_setsecasidx(proto, mode, reqid, src0 + 1,
dst0 + 1, &saidx)) != 0)
return key_senderror(so, m, EINVAL);
@@ -5167,7 +5167,7 @@
if (type)
sav->natt_type = type->sadb_x_nat_t_type_type;
if (sport)
- key_porttosaddr(&sav->sah->saidx.src,
+ key_porttosaddr(&sav->sah->saidx.src,
sport->sadb_x_nat_t_port_port);
if (dport)
key_porttosaddr(&sav->sah->saidx.dst,
@@ -5213,7 +5213,7 @@
mhp->ext[SADB_X_EXT_NAT_T_DPORT];
if (sport)
- key_porttosaddr(src,
+ key_porttosaddr(src,
sport->sadb_x_nat_t_port_port);
if (dport)
key_porttosaddr(dst,
@@ -5294,7 +5294,7 @@
src0 = (struct sadb_address *)(mhp->ext[SADB_EXT_ADDRESS_SRC]);
dst0 = (struct sadb_address *)(mhp->ext[SADB_EXT_ADDRESS_DST]);
- if ((error = key_setsecasidx(proto, mode, reqid, src0 + 1,
+ if ((error = key_setsecasidx(proto, mode, reqid, src0 + 1,
dst0 + 1, &saidx)) != 0)
return key_senderror(so, m, EINVAL);
@@ -5729,7 +5729,7 @@
src0 = (struct sadb_address *)(mhp->ext[SADB_EXT_ADDRESS_SRC]);
dst0 = (struct sadb_address *)(mhp->ext[SADB_EXT_ADDRESS_DST]);
- if ((error = key_setsecasidx(proto, IPSEC_MODE_ANY, 0, src0 + 1,
+ if ((error = key_setsecasidx(proto, IPSEC_MODE_ANY, 0, src0 + 1,
dst0 + 1, &saidx)) != 0)
return key_senderror(so, m, EINVAL);
@@ -5876,7 +5876,7 @@
*/
static int
key_get(struct socket *so, struct mbuf *m,
- const struct sadb_msghdr *mhp)
+ const struct sadb_msghdr *mhp)
{
struct sadb_sa *sa0;
struct sadb_address *src0, *dst0;
@@ -5913,7 +5913,6 @@
src0 = (struct sadb_address *)mhp->ext[SADB_EXT_ADDRESS_SRC];
dst0 = (struct sadb_address *)mhp->ext[SADB_EXT_ADDRESS_DST];
-
if ((error = key_setsecasidx(proto, IPSEC_MODE_ANY, 0, src0 + 1,
dst0 + 1, &saidx)) != 0)
return key_senderror(so, m, EINVAL);
Home |
Main Index |
Thread Index |
Old Index