Conditional compilation of localnetwork matching

Some architectures (esp32) might not have this API.

Fixes: #263

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2024-08-02 09:56:43 +02:00
parent 894e07aede
commit 9634668258
5 changed files with 29 additions and 9 deletions

View File

@@ -48,11 +48,15 @@ if (UNIX AND NOT WIN32)
torture_pki_ed25519
# requires /dev/null
torture_channel
# requires some non-standard API from netdb.h, in.h
# and arpa/inet.h for handling IP addresses
torture_config_match_localnetwork
)
if (HAVE_IFADDRS_H)
set(LIBSSH_UNIT_TESTS
${LIBSSH_UNIT_TESTS}
# requires some non-standard API from netdb.h, in.h
# and arpa/inet.h for handling IP addresses
torture_config_match_localnetwork
)
endif (HAVE_IFADDRS_H)
if (WITH_SERVER)
set(LIBSSH_UNIT_TESTS
${LIBSSH_UNIT_TESTS}

View File

@@ -3,7 +3,9 @@
#include "libssh/options.h"
#include "libssh/session.h"
#include "match.c"
#ifdef HAVE_IFADDRS_H
#include <ifaddrs.h>
#endif
#include <net/if.h>
#include <stdbool.h>