From c7120854068b692e38ddeb62af7551052808fd38 Mon Sep 17 00:00:00 2001 From: hselasky Date: Sun, 25 Feb 2018 11:29:55 +0000 Subject: [PATCH] Fix for LINT-{NOINET,NOINET6,NOIP} kernel builds. This is a direct commit. Reported by: rpokala@ Sponsored by: Mellanox Technologies git-svn-id: svn://svn.freebsd.org/base/stable/10@329982 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/netinet/toecore.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/netinet/toecore.c b/sys/netinet/toecore.c index 60e5fd4f4..a450cce7d 100644 --- a/sys/netinet/toecore.c +++ b/sys/netinet/toecore.c @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(KLD_MODULE) || defined(INET) || defined(INET6) + #include #include #include @@ -357,12 +359,20 @@ toe_4tuple_check(struct in_conninfo *inc, struct tcphdr *th, struct ifnet *ifp) struct inpcb *inp; if (inc->inc_flags & INC_ISIPV6) { +#if defined(KLD_MODULE) || defined(INET6) inp = in6_pcblookup(&V_tcbinfo, &inc->inc6_faddr, inc->inc_fport, &inc->inc6_laddr, inc->inc_lport, INPLOOKUP_WLOCKPCB, ifp); +#else + inp = NULL; +#endif } else { +#if defined(KLD_MODULE) || defined(INET) inp = in_pcblookup(&V_tcbinfo, inc->inc_faddr, inc->inc_fport, inc->inc_laddr, inc->inc_lport, INPLOOKUP_WLOCKPCB, ifp); +#else + inp = NULL; +#endif } if (inp != NULL) { INP_WLOCK_ASSERT(inp); @@ -641,5 +651,8 @@ static moduledata_t mod_data= { 0 }; -MODULE_VERSION(toecore, 1); DECLARE_MODULE(toecore, mod_data, SI_SUB_EXEC, SI_ORDER_ANY); +#endif /* defined(KLD_MODULE) || defined(INET) || defined(INET6) */ + +MODULE_VERSION(toecore, 1); + -- 2.45.0