git: cea9f49f820e - main - ping: low-effort fix to make it compilable without inet

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Wed, 05 Jul 2023 10:03:28 UTC
The branch main has been updated by mjg:

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

commit cea9f49f820e7dfab48fc4d1fac3497bc138081b
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2023-07-05 10:00:44 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2023-07-05 10:02:32 +0000

    ping: low-effort fix to make it compilable without inet
---
 sbin/ifconfig/ifpfsync.c |  4 ++++
 sbin/ifconfig/ifvxlan.c  | 12 ++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/sbin/ifconfig/ifpfsync.c b/sbin/ifconfig/ifpfsync.c
index b97b9925c644..3e880c96a97c 100644
--- a/sbin/ifconfig/ifpfsync.c
+++ b/sbin/ifconfig/ifpfsync.c
@@ -125,6 +125,10 @@ pfsync_syncpeer_nvlist_to_sockaddr(const nvlist_t *nvl,
 {
 	int af;
 
+#if (!defined INET && !defined INET6)
+	(void)sa;
+#endif
+
 	if (!nvlist_exists_number(nvl, "af"))
 		return (EINVAL);
 	if (!nvlist_exists_binary(nvl, "address"))
diff --git a/sbin/ifconfig/ifvxlan.c b/sbin/ifconfig/ifvxlan.c
index 72e2eac35c2d..6a0bacfc32a6 100644
--- a/sbin/ifconfig/ifvxlan.c
+++ b/sbin/ifconfig/ifvxlan.c
@@ -213,7 +213,9 @@ setvxlan_local(if_ctx *ctx, const char *addr, int dummy __unused)
 {
 	struct ifvxlancmd cmd;
 	struct addrinfo *ai;
+#if (defined INET || defined INET6)
 	struct sockaddr *sa;
+#endif
 	int error;
 
 	bzero(&cmd, sizeof(cmd));
@@ -222,7 +224,9 @@ setvxlan_local(if_ctx *ctx, const char *addr, int dummy __unused)
 		errx(1, "error in parsing local address string: %s",
 		    gai_strerror(error));
 
+#if (defined INET || defined INET6)
 	sa = ai->ai_addr;
+#endif
 
 	switch (ai->ai_family) {
 #ifdef INET
@@ -273,7 +277,9 @@ setvxlan_remote(if_ctx *ctx, const char *addr, int dummy __unused)
 {
 	struct ifvxlancmd cmd;
 	struct addrinfo *ai;
+#if (defined INET || defined INET6)
 	struct sockaddr *sa;
+#endif
 	int error;
 
 	bzero(&cmd, sizeof(cmd));
@@ -282,7 +288,9 @@ setvxlan_remote(if_ctx *ctx, const char *addr, int dummy __unused)
 		errx(1, "error in parsing remote address string: %s",
 		    gai_strerror(error));
 
+#if (defined INET || defined INET6)
 	sa = ai->ai_addr;
+#endif
 
 	switch (ai->ai_family) {
 #ifdef INET
@@ -333,7 +341,9 @@ setvxlan_group(if_ctx *ctx, const char *addr, int dummy __unused)
 {
 	struct ifvxlancmd cmd;
 	struct addrinfo *ai;
+#if (defined INET || defined INET6)
 	struct sockaddr *sa;
+#endif
 	int error;
 
 	bzero(&cmd, sizeof(cmd));
@@ -342,7 +352,9 @@ setvxlan_group(if_ctx *ctx, const char *addr, int dummy __unused)
 		errx(1, "error in parsing group address string: %s",
 		    gai_strerror(error));
 
+#if (defined INET || defined INET6)
 	sa = ai->ai_addr;
+#endif
 
 	switch (ai->ai_family) {
 #ifdef INET