summaryrefslogtreecommitdiffstats
path: root/sys/netipsec
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2003-02-24 02:06:02 +0000
committerjlemon <jlemon@FreeBSD.org>2003-02-24 02:06:02 +0000
commit17b1f4c5267869fc15cf243a9f2590aee40aa55a (patch)
treede83bccd479ad533bf6ec62a670a646af98de867 /sys/netipsec
parentec3fae0b413fe83c6701317f70d198a03e1d0c6a (diff)
downloadFreeBSD-src-17b1f4c5267869fc15cf243a9f2590aee40aa55a.zip
FreeBSD-src-17b1f4c5267869fc15cf243a9f2590aee40aa55a.tar.gz
Update to work with the new timewait state.
Reviewed by: sam
Diffstat (limited to 'sys/netipsec')
-rw-r--r--sys/netipsec/ipsec.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/sys/netipsec/ipsec.c b/sys/netipsec/ipsec.c
index 2e765e0..59c5986 100644
--- a/sys/netipsec/ipsec.c
+++ b/sys/netipsec/ipsec.c
@@ -280,7 +280,6 @@ ipsec_getpolicybysock(m, dir, inp, error)
struct inpcbpolicy *pcbsp = NULL;
struct secpolicy *currsp = NULL; /* policy on socket */
struct secpolicy *sp;
- int af;
KASSERT(m != NULL, ("ipsec_getpolicybysock: null mbuf"));
KASSERT(inp != NULL, ("ipsec_getpolicybysock: null inpcb"));
@@ -288,26 +287,13 @@ ipsec_getpolicybysock(m, dir, inp, error)
KASSERT(dir == IPSEC_DIR_INBOUND || dir == IPSEC_DIR_OUTBOUND,
("ipsec_getpolicybysock: invalid direction %u", dir));
- af = inp->inp_socket->so_proto->pr_domain->dom_family;
- KASSERT(af == AF_INET || af == AF_INET6,
- ("ipsec_getpolicybysock: unexpected protocol family %u", af));
-
- switch (af) {
- case AF_INET:
- /* set spidx in pcb */
- *error = ipsec4_setspidx_inpcb(m, inp);
- pcbsp = inp->inp_sp;
- break;
-#ifdef INET6
- case AF_INET6:
- /* set spidx in pcb */
+ /* set spidx in pcb */
+ if (inp->inp_vflag & INP_IPV6PROTO) {
*error = ipsec6_setspidx_in6pcb(m, inp);
pcbsp = inp->in6p_sp;
- break;
-#endif
- default:
- *error = EPFNOSUPPORT;
- break;
+ } else {
+ *error = ipsec4_setspidx_inpcb(m, inp);
+ pcbsp = inp->inp_sp;
}
if (*error)
return NULL;
@@ -1571,8 +1557,6 @@ ipsec4_hdrsiz(m, dir, inp)
size_t size;
KASSERT(m != NULL, ("ipsec4_hdrsiz: null mbuf"));
- KASSERT(inp == NULL || inp->inp_socket != NULL,
- ("ipsec4_hdrsize: socket w/o inpcb"));
/* get SP for this packet.
* When we are called from ip_forward(), we call
OpenPOWER on IntegriCloud