git: 127b40e7dcdb - main - vtnet: offset is only used for INET or INET6.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 13 Apr 2022 23:09:31 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=127b40e7dcdbd5cc1ffc189b59bb8f8531716f76

commit 127b40e7dcdbd5cc1ffc189b59bb8f8531716f76
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-13 23:08:21 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-13 23:08:21 +0000

    vtnet: offset is only used for INET or INET6.
---
 sys/dev/virtio/network/if_vtnet.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
index 0a020e6b6c91..bb659b7b2ef5 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -2359,7 +2359,9 @@ vtnet_txq_offload_ctx(struct vtnet_txq *txq, struct mbuf *m, int *etype,
 {
 	struct vtnet_softc *sc;
 	struct ether_vlan_header *evh;
+#if defined(INET) || defined(INET6)
 	int offset;
+#endif
 
 	sc = txq->vtntx_sc;
 
@@ -2367,10 +2369,14 @@ vtnet_txq_offload_ctx(struct vtnet_txq *txq, struct mbuf *m, int *etype,
 	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) {