git: 88646c4e5f92 - main - virtio: plug some of set-but-not-used vars

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Tue, 14 Dec 2021 14:39:14 UTC
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=88646c4e5f9224748939727eb973622714b924cc

commit 88646c4e5f9224748939727eb973622714b924cc
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2021-12-14 14:38:42 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2021-12-14 14:38:42 +0000

    virtio: plug some of set-but-not-used vars
    
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/dev/virtio/network/virtio_net.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sys/dev/virtio/network/virtio_net.h b/sys/dev/virtio/network/virtio_net.h
index da5aea4a29e6..412352a35bf3 100644
--- a/sys/dev/virtio/network/virtio_net.h
+++ b/sys/dev/virtio/network/virtio_net.h
@@ -413,16 +413,22 @@ static inline int
 virtio_net_tx_offload_ctx(struct mbuf *m, int *etype, int *proto, int *start)
 {
 	struct ether_vlan_header *evh;
+#if defined(INET) || defined(INET6)
 	int offset;
+#endif
 
 	evh = mtod(m, struct ether_vlan_header *);
 	if (evh->evl_encap_proto == htons(ETHERTYPE_VLAN)) {
 		/* BMV: We should handle nested VLAN tags too. */
 		*etype = ntohs(evh->evl_proto);
+#if defined(INET) || defined(INET6)
 		offset = sizeof(struct ether_vlan_header);
+#endif
 	} else {
 		*etype = ntohs(evh->evl_encap_proto);
+#if defined(INET) || defined(INET6)
 		offset = sizeof(struct ether_header);
+#endif
 	}
 
 	switch (*etype) {