diff options
author | np <np@FreeBSD.org> | 2013-01-25 20:45:24 +0000 |
---|---|---|
committer | np <np@FreeBSD.org> | 2013-01-25 20:45:24 +0000 |
commit | 502e79cf50725bcb8374d341f728c058c200b758 (patch) | |
tree | 0a0daf958e4b8caa6638018ad336988d7eafb9be | |
parent | b08297aaa1fcce883e6542ddf97183fd7a767bb1 (diff) | |
download | FreeBSD-src-502e79cf50725bcb8374d341f728c058c200b758.zip FreeBSD-src-502e79cf50725bcb8374d341f728c058c200b758.tar.gz |
Teach toe_4tuple_check() to deal with IPv6 4-tuples too.
Reviewed by: bz@
-rw-r--r-- | sys/netinet/toecore.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/netinet/toecore.c b/sys/netinet/toecore.c index 7e498dd..f7e2ba3 100644 --- a/sys/netinet/toecore.c +++ b/sys/netinet/toecore.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include <netinet/in.h> #include <netinet/in_pcb.h> #include <netinet/in_var.h> +#include <netinet6/in6_pcb.h> #include <netinet6/nd6.h> #define TCPSTATES #include <netinet/tcp.h> @@ -355,11 +356,14 @@ toe_4tuple_check(struct in_conninfo *inc, struct tcphdr *th, struct ifnet *ifp) { struct inpcb *inp; - if (inc->inc_flags & INC_ISIPV6) - return (ENOSYS); /* XXX: implement */ - - inp = in_pcblookup(&V_tcbinfo, inc->inc_faddr, inc->inc_fport, - inc->inc_laddr, inc->inc_lport, INPLOOKUP_WLOCKPCB, ifp); + if (inc->inc_flags & INC_ISIPV6) { + inp = in6_pcblookup(&V_tcbinfo, &inc->inc6_faddr, + inc->inc_fport, &inc->inc6_laddr, inc->inc_lport, + INPLOOKUP_WLOCKPCB, ifp); + } else { + inp = in_pcblookup(&V_tcbinfo, inc->inc_faddr, inc->inc_fport, + inc->inc_laddr, inc->inc_lport, INPLOOKUP_WLOCKPCB, ifp); + } if (inp != NULL) { INP_WLOCK_ASSERT(inp); |