summaryrefslogtreecommitdiffstats
path: root/sys/netipsec/key.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2008-12-15 21:50:54 +0000
committerbz <bz@FreeBSD.org>2008-12-15 21:50:54 +0000
commit03f6bb9dc9b98a515613b815d92f251d470edfeb (patch)
tree30c97711914bd53cfed83d5b45b42b5a723ba6b1 /sys/netipsec/key.c
parentea29c11cdebf56f08c85084a4e99c193160a87b7 (diff)
downloadFreeBSD-src-03f6bb9dc9b98a515613b815d92f251d470edfeb.zip
FreeBSD-src-03f6bb9dc9b98a515613b815d92f251d470edfeb.tar.gz
Another step assimilating IPv[46] PCB code - directly use
the inpcb names rather than the following IPv6 compat macros: in6pcb,in6p_sp, in6p_ip6_nxt,in6p_flowinfo,in6p_vflag, in6p_flags,in6p_socket,in6p_lport,in6p_fport,in6p_ppcb and sotoin6pcb(). Apart from removing duplicate code in netipsec, this is a pure whitespace, not a functional change. Discussed with: rwatson Reviewed by: rwatson (version before review requested changes) MFC after: 4 weeks (set the timer and see then)
Diffstat (limited to 'sys/netipsec/key.c')
-rw-r--r--sys/netipsec/key.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index f65d1f1..4906999 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -1160,42 +1160,24 @@ key_freeso(struct socket *so)
IPSEC_ASSERT(so != NULL, ("null so"));
switch (so->so_proto->pr_domain->dom_family) {
+#if defined(INET) || defined(INET6)
#ifdef INET
case PF_INET:
- {
- struct inpcb *pcb = sotoinpcb(so);
-
- /* Does it have a PCB ? */
- if (pcb == NULL)
- return;
- key_freesp_so(&pcb->inp_sp->sp_in);
- key_freesp_so(&pcb->inp_sp->sp_out);
- }
- break;
#endif
#ifdef INET6
case PF_INET6:
+#endif
{
-#ifdef HAVE_NRL_INPCB
- struct inpcb *pcb = sotoinpcb(so);
+ struct inpcb *pcb = sotoinpcb(so);
/* Does it have a PCB ? */
if (pcb == NULL)
return;
key_freesp_so(&pcb->inp_sp->sp_in);
key_freesp_so(&pcb->inp_sp->sp_out);
-#else
- struct in6pcb *pcb = sotoin6pcb(so);
-
- /* Does it have a PCB ? */
- if (pcb == NULL)
- return;
- key_freesp_so(&pcb->in6p_sp->sp_in);
- key_freesp_so(&pcb->in6p_sp->sp_out);
-#endif
}
break;
-#endif /* INET6 */
+#endif /* INET || INET6 */
default:
ipseclog((LOG_DEBUG, "%s: unknown address family=%d.\n",
__func__, so->so_proto->pr_domain->dom_family));
OpenPOWER on IntegriCloud