summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7648969)
raw | patch | inline | side by side (parent: 7648969)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 5 Apr 2010 14:22:30 +0000 (16:22 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 5 Apr 2010 14:22:30 +0000 (16:22 +0200) |
Use this information rather than hard-coding "if Linux …"
configure.in | patch | blob | history | |
src/network.c | patch | blob | history |
diff --git a/configure.in b/configure.in
index b5ce7812c9d18f96088d602335f483971700b0d3..f3206cb6895a04c1019ca1d385eacf41e0fe1cd2 100644 (file)
--- a/configure.in
+++ b/configure.in
# Checks for library functions.
#
AC_PROG_GCC_TRADITIONAL
-AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf)
+AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf if_indextoname)
AC_FUNC_STRERROR_R
diff --git a/src/network.c b/src/network.c
index 6d0381b7c7b813a3ff013daf70a7323600874997..9cb8c38e071344a24fde6aa3909b99f619fe0cc9 100644 (file)
--- a/src/network.c
+++ b/src/network.c
@@ -1653,7 +1653,7 @@ static int network_set_interface (const sockent_t *se, const struct addrinfo *ai
}
}
-#if KERNEL_LINUX
+#if defined(HAVE_IF_INDEXTONAME) && HAVE_IF_INDEXTONAME && defined(SO_BINDTODEVICE)
if (se->interface != 0)
{
char interface_name[IFNAMSIZ];
@@ -1673,7 +1673,7 @@ static int network_set_interface (const sockent_t *se, const struct addrinfo *ai
return (-1);
}
}
-#endif
+#endif /* HAVE_IF_INDEXTONAME && SO_BINDTODEVICE */
return (0);
} /* }}} network_set_interface */
@@ -1798,7 +1798,7 @@ static int network_bind_socket (int fd, const struct addrinfo *ai, const int int
}
}
-#if KERNEL_LINUX
+#if defined(HAVE_IF_INDEXTONAME) && HAVE_IF_INDEXTONAME && defined(SO_BINDTODEVICE)
/* if a specific interface was set, bind the socket to it. But to avoid
* possible problems with multicast routing, only do that for non-multicast
* addresses */
@@ -1821,7 +1821,7 @@ static int network_bind_socket (int fd, const struct addrinfo *ai, const int int
return (-1);
}
}
-#endif
+#endif /* HAVE_IF_INDEXTONAME && SO_BINDTODEVICE */
return (0);
} /* int network_bind_socket */