Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netipsec KNF
details: https://anonhg.NetBSD.org/src/rev/6ba8932eef50
branches: trunk
changeset: 354366:6ba8932eef50
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Wed Jun 14 02:00:43 2017 +0000
description:
KNF
diffstat:
sys/netipsec/ipsec.c | 22 +++++++++-------------
1 files changed, 9 insertions(+), 13 deletions(-)
diffs (78 lines):
diff -r fde0c6d1560d -r 6ba8932eef50 sys/netipsec/ipsec.c
--- a/sys/netipsec/ipsec.c Wed Jun 14 00:52:37 2017 +0000
+++ b/sys/netipsec/ipsec.c Wed Jun 14 02:00:43 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec.c,v 1.99 2017/06/02 03:41:20 ozaki-r Exp $ */
+/* $NetBSD: ipsec.c,v 1.100 2017/06/14 02:00:43 ozaki-r Exp $ */
/* $FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $ */
/* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.99 2017/06/02 03:41:20 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.100 2017/06/14 02:00:43 ozaki-r Exp $");
/*
* IPsec controller part.
@@ -237,10 +237,8 @@
* might have lower priority than a rule that would otherwise
* have matched the packet.
*/
-
if (memcmp(&pcbsp->sp_cache[dir].cacheidx, &spidx, sizeof(spidx)))
return NULL;
-
} else {
/*
* The pcb is connected, and the L4 code is sure that:
@@ -296,11 +294,11 @@
case IPSEC_POLICY_NONE:
case IPSEC_POLICY_BYPASS:
pcbsp->sp_cache[dir].cachehint =
- IPSEC_PCBHINT_NO;
+ IPSEC_PCBHINT_NO;
break;
default:
pcbsp->sp_cache[dir].cachehint =
- IPSEC_PCBHINT_YES;
+ IPSEC_PCBHINT_YES;
}
}
}
@@ -325,7 +323,7 @@
pcbsp->sp_cache[i].cachehint = IPSEC_PCBHINT_UNKNOWN;
pcbsp->sp_cache[i].cachegen = 0;
memset(&pcbsp->sp_cache[i].cacheidx, 0,
- sizeof(pcbsp->sp_cache[i].cacheidx));
+ sizeof(pcbsp->sp_cache[i].cacheidx));
}
return 0;
}
@@ -916,9 +914,9 @@
pcb->inp_sp->sp_out->spidx.dir = IPSEC_DIR_OUTBOUND;
} else {
memset(&pcb->inp_sp->sp_in->spidx, 0,
- sizeof (pcb->inp_sp->sp_in->spidx));
+ sizeof(pcb->inp_sp->sp_in->spidx));
memset(&pcb->inp_sp->sp_out->spidx, 0,
- sizeof (pcb->inp_sp->sp_in->spidx));
+ sizeof(pcb->inp_sp->sp_in->spidx));
}
return error;
}
@@ -1133,11 +1131,9 @@
if (m->m_len < sizeof (struct ip)) {
m_copydata(m, offsetof(struct ip, ip_src),
- sizeof (struct in_addr),
- &spidx->src.sin.sin_addr);
+ sizeof(struct in_addr), &spidx->src.sin.sin_addr);
m_copydata(m, offsetof(struct ip, ip_dst),
- sizeof (struct in_addr),
- &spidx->dst.sin.sin_addr);
+ sizeof(struct in_addr), &spidx->dst.sin.sin_addr);
} else {
struct ip *ip = mtod(m, struct ip *);
spidx->src.sin.sin_addr = ip->ip_src;
Home |
Main Index |
Thread Index |
Old Index