]> git.meshlink.io Git - meshlink/blobdiff - src/net.c
Fix android (Android 6 or before) compilation issue around getifaddr
[meshlink] / src / net.c
index 7c600534e3a682488200bbfa9f4cf320e7fe11f3..95790ac1d287c84ed4f11e8cd19019288b2549b3 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -639,7 +639,7 @@ void retry(meshlink_handle_t *mesh) {
                });
        }
 
-#ifdef HAVE_IFADDRS_H
+#if defined(HAVE_IFADDRS_H) && defined(HAVE_GETIFADDRS) && defined(HAVE_FREEIFADDRS)
        struct ifaddrs *ifa = NULL;
        getifaddrs(&ifa);
 #endif
@@ -655,7 +655,7 @@ void retry(meshlink_handle_t *mesh) {
                        c->last_ping_time = 0;
                }
 
-#ifdef HAVE_IFADDRS_H
+#if defined(HAVE_IFADDRS_H) && defined(HAVE_GETIFADDRS) && defined(HAVE_FREEIFADDRS)
 
                if(!ifa) {
                        continue;
@@ -686,7 +686,7 @@ void retry(meshlink_handle_t *mesh) {
 #endif
        }
 
-#ifdef HAVE_IFADDRS_H
+#if defined(HAVE_IFADDRS_H) && defined(HAVE_GETIFADDRS) && defined(HAVE_FREEIFADDRS)
 
        if(ifa) {
                freeifaddrs(ifa);