git: 52bcdc5b809e - main - if_epair: fix build with RSS and INET or INET6 disabled

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Thu, 03 Mar 2022 17:31:46 UTC
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=52bcdc5b809ea56cbdce0bd36499e4ae74780d2b

commit 52bcdc5b809ea56cbdce0bd36499e4ae74780d2b
Author:     Santiago Martinez <sm@codenetworks.net>
AuthorDate: 2022-03-03 09:44:43 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2022-03-03 17:31:26 +0000

    if_epair: fix build with RSS and INET or INET6 disabled
    
    Reviewed by:    kp
    MFC after:      1 week
---
 sys/modules/if_epair/Makefile |  2 +-
 sys/net/if_epair.c            | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/sys/modules/if_epair/Makefile b/sys/modules/if_epair/Makefile
index 3e102413bfe2..8b063623f2e8 100644
--- a/sys/modules/if_epair/Makefile
+++ b/sys/modules/if_epair/Makefile
@@ -3,6 +3,6 @@
 .PATH: ${SRCTOP}/sys/net
 
 KMOD=	if_epair
-SRCS=	bus_if.h device_if.h if_epair.c
+SRCS=	bus_if.h device_if.h if_epair.c opt_rss.h opt_inet.h opt_inet6.h
 
 .include <bsd.kmod.mk>
diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c
index 629de981d5b0..c39434b31b9f 100644
--- a/sys/net/if_epair.c
+++ b/sys/net/if_epair.c
@@ -41,6 +41,8 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_rss.h"
+#include "opt_inet.h"
+#include "opt_inet6.h"
 
 #include <sys/param.h>
 #include <sys/hash.h>
@@ -73,9 +75,13 @@ __FBSDID("$FreeBSD$");
 #include <net/netisr.h>
 #ifdef RSS
 #include <net/rss_config.h>
+#ifdef INET
 #include <netinet/in_rss.h>
+#endif
+#ifdef INET6
 #include <netinet6/in6_rss.h>
 #endif
+#endif
 #include <net/vnet.h>
 
 static int epair_clone_match(struct if_clone *, const char *);
@@ -217,12 +223,16 @@ epair_menq(struct mbuf *m, struct epair_softc *osc)
 		eh = mtod(m, struct ether_header *);
 
 		switch (ntohs(eh->ether_type)) {
+#ifdef INET
 		case ETHERTYPE_IP:
 			rss_soft_m2cpuid_v4(m, 0, &bucket);
 			break;
+#endif
+#ifdef INET6
 		case ETHERTYPE_IPV6:
 			rss_soft_m2cpuid_v6(m, 0, &bucket);
 			break;
+#endif
 		default:
 			bucket = 0;
 			break;