svn commit: r245916 - head/sys/netinet
Navdeep Parhar
np at FreeBSD.org
Fri Jan 25 20:45:25 UTC 2013
Author: np
Date: Fri Jan 25 20:45:24 2013
New Revision: 245916
URL: http://svnweb.freebsd.org/changeset/base/245916
Log:
Teach toe_4tuple_check() to deal with IPv6 4-tuples too.
Reviewed by: bz@
Modified:
head/sys/netinet/toecore.c
Modified: head/sys/netinet/toecore.c
==============================================================================
--- head/sys/netinet/toecore.c Fri Jan 25 20:23:33 2013 (r245915)
+++ head/sys/netinet/toecore.c Fri Jan 25 20:45:24 2013 (r245916)
@@ -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 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);
More information about the svn-src-head
mailing list