Skip to content

Commit 1b2a89a

Browse files
committed
standard/net: even field a bit more with windows by adding interface's MTU data.
1 parent d3eb6a6 commit 1b2a89a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/standard/net.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
# include <iphlpapi.h>
4646
#else
4747
# ifdef HAVE_SYS_IOCTL_H
48+
# define BSD_COMP 1
4849
# include <sys/ioctl.h>
50+
# include <fcntl.h>
4951
# endif
5052
# include <netdb.h>
5153
#endif
@@ -56,7 +58,11 @@ static zend_result net_get_mtu(char *ifname, zend_long *mtu)
5658
#ifdef SIOCGIFMTU
5759
struct ifreq ifr = {0};
5860
zend_result status = FAILURE;
61+
#ifndef __sun
5962
int local = socket(AF_UNIX, SOCK_DGRAM, 0);
63+
#else
64+
int local = open("/dev/ip", O_RDONLY);
65+
#endif
6066
if (local == -1) {
6167
return FAILURE;
6268
}

0 commit comments

Comments
 (0)