git: 78de1d02e0ce - stable/13 - vnic: fix compilation of an IPv6 only kernel

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Thu, 01 Aug 2024 20:04:39 UTC
The branch stable/13 has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=78de1d02e0cebc2009e0dcb04b7b7309f326133a

commit 78de1d02e0cebc2009e0dcb04b7b7309f326133a
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2024-02-06 21:47:16 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2024-08-01 20:02:55 +0000

    vnic: fix compilation of an IPv6 only kernel
    
    Sponsored by:   Netflix, Inc.
    
    (cherry picked from commit 1d3d30c8d2e41052796c5bdd9220d7e3daabccad)
---
 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 4410bd4998dd..e1f434d0eb18 100644
--- a/sys/dev/vnic/nicvf_queues.c
+++ b/sys/dev/vnic/nicvf_queues.c
@@ -1744,10 +1744,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;