NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/55782: INET/INET6 only semi-optional



>Number:         55782
>Category:       kern
>Synopsis:       options INET/INET6 only semi-optional
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 04 03:00:00 +0000 2020
>Originator:     Mouse
>Release:        NetBSD 9.1
>Organization:
	Dis-
>Environment:
System: NetBSD Aaeon.Rodents-Montreal.ORG 9.1 NetBSD 9.1 (GEN91) #3: Tue Oct 27 09:41:42 EDT 2020 mouse%Aaeon.Rodents-Montreal.ORG@localhost:/home/mouse/kbuild/GEN91 amd64
Architecture: x86_64
Machine: amd64
>Description:
	A kernel configured with neither INET nor INET6 does not build.
>How-To-Repeat:
	Try it: copy GENERIC, remove INET and INET6, configure, and try
	to build the result.  I get errors in

	dev/ic/gem.c
	net/if_fddisubr.c
	net/if_loop.c
	net/if_ppp.c
	net/if_sl.c
	net/if_spppsubr.c
	net/if_strip.c
	net/if_vlan.c
	netipsec/ipsec_input.c
	netipsec/ipsec_output.c
	dev/pci/ixgbe/ix_txrx.c
	net/slcompress.c
	dev/usb/uhso.c
	netipsec/xform_ah.c
	netipsec/xform_ipip.c

	and a disturbing number of warnings elsewhere (mostly "this
	statement may fall through", to which my reaction is "if NetBSD
	cares about this, why hasn't it been fixed? if not, why is the
	warning turned on?" - but those in general do not look related
	to the INET/INET6 removal).

	Some of the above (eg, all the IPsec files) are not surprising
	and probably don't really call for fixing, but some, I think,
	are real issues.

	This discovery arose from an attempt to build a cut-back kernel
	for work, for an application which uses Ethernet but not IP; in
	that kernel I removed IPsec, PPP, and a bunch of devices (such
	as sl and vlan), but I recognize gem.c, if_loop.c, and
	ix_txrx.c in the above list as being ones I had to fix.
>Fix:
	These fix the ones that were causing me trouble with the
	cut-back kernel.  Depending on which of the others people care
	about, perhaps some or all of the others of the above list
	should be fixed too.

	These should be relative to stock 9.1 source.  There are other
	commits between this commit and by base 9.1 import, but none of
	them touch any of these three files.

diff --git a/usr/src/sys/dev/ic/gem.c b/usr/src/sys/dev/ic/gem.c
index 6b39db1..26cf79d 100644
--- a/usr/src/sys/dev/ic/gem.c
+++ b/usr/src/sys/dev/ic/gem.c
@@ -1389,7 +1389,9 @@ gem_start(struct ifnet *ifp)
 	 * until we drain the queue, or use up all available transmit
 	 * descriptors.
 	 */
+#ifdef INET
 next:
+#endif
 	while ((txs = SIMPLEQ_FIRST(&sc->sc_txfreeq)) != NULL &&
 	    sc->sc_txfree != 0) {
 		/*
diff --git a/usr/src/sys/dev/pci/ixgbe/ix_txrx.c b/usr/src/sys/dev/pci/ixgbe/ix_txrx.c
index b7b9144..1104792 100644
--- a/usr/src/sys/dev/pci/ixgbe/ix_txrx.c
+++ b/usr/src/sys/dev/pci/ixgbe/ix_txrx.c
@@ -829,8 +829,9 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp,
 	u16                              vtag = 0;
 	u16                              etype;
 	u8                               ipproto = 0;
+#if defined(INET) || defined(INET6)
 	char                             *l3d;
-
+#endif
 
 	/* First check if TSO is to be used */
 	if (mp->m_pkthdr.csum_flags & (M_CSUM_TSOv4 | M_CSUM_TSOv6)) {
@@ -884,6 +885,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp,
 	if (offload == FALSE)
 		goto no_offloads;
 
+#if defined(INET) || defined(INET6)
 	/*
 	 * If the first mbuf only includes the ethernet header,
 	 * jump to the next one
@@ -895,7 +897,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp,
 		l3d = mtod(mp->m_next, char *);
 	else
 		l3d = mtod(mp, char *) + ehdrlen;
-
+#endif
 	switch (etype) {
 #ifdef INET
 	case ETHERTYPE_IP:
diff --git a/usr/src/sys/net/if_loop.c b/usr/src/sys/net/if_loop.c
index 026b05a..7e4f6c2 100644
--- a/usr/src/sys/net/if_loop.c
+++ b/usr/src/sys/net/if_loop.c
@@ -248,7 +248,9 @@ looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
 	pktqueue_t *pktq = NULL;
 	struct ifqueue *ifq = NULL;
 	int s, isr = -1;
+#if defined(INET) || defined(INET6)
 	int csum_flags;
+#endif
 	int error = 0;
 	size_t pktlen;
 

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B



Home | Main Index | Thread Index | Old Index