git: 1d3d30c8d2e4 - main - vnic: fix compilation of an IPv6 only kernel

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Tue, 06 Feb 2024 21:49:39 UTC
The branch main has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=1d3d30c8d2e41052796c5bdd9220d7e3daabccad

commit 1d3d30c8d2e41052796c5bdd9220d7e3daabccad
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2024-02-06 21:47:16 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2024-02-06 21:47:16 +0000

    vnic: fix compilation of an IPv6 only kernel
    
    MFC after:      1 week
    Sponsored by:   Netflix, Inc.
---
 sys/dev/vnic/nicvf_queues.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sys/dev/vnic/nicvf_queues.c b/sys/dev/vnic/nicvf_queues.c
index 6b6a36317f63..45d6b54b18ed 100644
--- a/sys/dev/vnic/nicvf_queues.c
+++ b/sys/dev/vnic/nicvf_queues.c
@@ -1749,10 +1749,15 @@ nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qentry,
 	struct ether_vlan_header *eh;
 #ifdef INET
 	struct ip *ip;
+#endif
+#if defined(INET6) || defined(INET)
 	struct tcphdr *th;
 #endif
+#ifdef INET
+	int iphlen;
+#endif
+	int ehdrlen, poff, proto;
 	uint16_t etype;
-	int ehdrlen, iphlen, poff, proto;
 
 	nic = sq->nic;