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

This commit is contained in:
Mateusz Guzik 2023-07-05 10:00:44 +00:00
parent 55e0aefae6
commit cea9f49f82
2 changed files with 16 additions and 0 deletions

View File

@ -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"))

View File

@ -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