about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/ifaddrs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/ifaddrs.c')
-rw-r--r--sysdeps/unix/sysv/linux/ifaddrs.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/ifaddrs.c b/sysdeps/unix/sysv/linux/ifaddrs.c
index 3921c40dc7..f4f8606892 100644
--- a/sysdeps/unix/sysv/linux/ifaddrs.c
+++ b/sysdeps/unix/sysv/linux/ifaddrs.c
@@ -43,9 +43,13 @@
 #if __ASSUME_NETLINK_SUPPORT == 0
 static int no_netlink_support;
 
-#define getifaddrs fallback_getifaddrs
-#include "sysdeps/gnu/ifaddrs.c"
-#undef getifaddrs
+# define getifaddrs fallback_getifaddrs
+# include "sysdeps/gnu/ifaddrs.c"
+# undef getifaddrs
+
+#else
+
+# define no_netlink_support 0
 
 #endif
 
@@ -292,7 +296,7 @@ getifaddrs (struct ifaddrs **ifap)
   if (ifap)
     *ifap = NULL;
 
-  if (netlink_open (&nh) < 0)
+  if (! no_netlink_support && netlink_open (&nh) < 0)
     {
 #if __ASSUME_NETLINK_SUPPORT == 0
        no_netlink_support = 1;