com php-src: Bugfix net_get_interfaces() on NetBSD : ext/standard/net.c
| From: | Sara Golemon | Date: | Mon, 27 Nov 2017 17:47:26 +0000 |
| Subject: | com php-src: Bugfix net_get_interfaces() on NetBSD : ext/standard/net.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100386@lists.php.net to get a copy of this message | ||
Commit: 6d57740818ef2fda408bf6fd86c2e7831f57389c
Author: Sara Golemon <pollita@php.net> Mon, 27 Nov 2017 12:47:26 -0500
Parents: 7ca5a7d84ebdc1b97f49cb460f200db093b96d9d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6d57740818ef2fda408bf6fd86c2e7831f57389c
Log:
Bugfix net_get_interfaces() on NetBSD
Changed paths:
M ext/standard/net.c
Diff:
diff --git a/ext/standard/net.c b/ext/standard/net.c
index f8d06e0..2aee77e 100644
--- a/ext/standard/net.c
+++ b/ext/standard/net.c
@@ -29,7 +29,6 @@
#if HAVE_GETIFADDRS
# include <ifaddrs.h>
-# include <netdb.h>
#endif
#ifdef PHP_WIN32
@@ -38,6 +37,8 @@
# include <ws2ipdef.h>
# include <Ws2tcpip.h>
# include <iphlpapi.h>
+#else
+# include <netdb.h>
#endif
PHPAPI zend_string* php_inet_ntop(const struct sockaddr *addr) {
@@ -95,6 +96,7 @@ PHPAPI zend_string* php_inet_ntop(const struct sockaddr *addr) {
return NULL;
}
+#if defined(PHP_WIN32) || HAVE_GETIFADDRS
static void iface_append_unicast(zval *unicast, zend_long flags,
struct sockaddr *addr, struct sockaddr *netmask,
struct sockaddr *broadcast, struct sockaddr *ptp) {
@@ -124,6 +126,7 @@ static void iface_append_unicast(zval *unicast, zend_long flags,
add_next_index_zval(unicast, &u);
}
+#endif
/* {{{ proto array|false net_get_interfaces()
Returns an array in the form: