Re: [PHP-DEV] net_get_interfaces()

This is only part of a thread. view whole thread
  101164
November 27, 2017 16:56 pollita@php.net (Sara Golemon)
On Mon, Nov 27, 2017 at 11:38 AM, Florian Anderiasch <ml@anderiasch.de> wrote:
> Somehow it doesn't match the > +#if HAVE_NET_IF_H > in net.c > > I had to unconditionally include it (for testing), otherwise > IFF_BROADCAST and IFF_POINTOPOINT are undefined. (they are in > sys/net/if.h on OpenBSD, but I only tested 6.2). > Can you send or gist your config.log? (Optionally redacted to the
net/if.h check if you want to do that yourself) Are you saying you simply removed the `#if HAVE_NET_IF_H` check? Or that you did that *AND* changed the include directive to `#include ` ?
> Can do a proper bug report if needed, but maybe I get around to test > NetBSD as well. > Thanks!
  101165
November 27, 2017 17:23 php@beccati.com (Matteo Beccati)
Hi everyone,

On 27/11/2017 17:56, Sara Golemon wrote:
>> Can do a proper bug report if needed, but maybe I get around to test >> NetBSD as well. >> > Thanks!
I've just tested a NetBSD 7.0 i386 machine and I'm getting a few errors: ext/standard/net.c: In function ‘php_inet_ntop’: ext/standard/net.c:82:41: error: ‘NI_MAXHOST’ undeclared (first use in this function) zend_string *ret = zend_string_alloc(NI_MAXHOST, 0); ^ ext/standard/net.c:82:41: note: each undeclared identifier is reported only once for each function it appears in ext/standard/net.c:83:4: warning: implicit declaration of function ‘getnameinfo’ [-Wimplicit-function-declaration] if (getnameinfo(addr, addrlen, ZSTR_VAL(ret), NI_MAXHOST, NULL, 0, NI_NUMERICHOST) == SUCCESS) { ^ ext/standard/net.c:83:71: error: ‘NI_NUMERICHOST’ undeclared (first use in this function) if (getnameinfo(addr, addrlen, ZSTR_VAL(ret), NI_MAXHOST, NULL, 0, NI_NUMERICHOST) == SUCCESS) { ^ ext/standard/net.c: At top level: ext/standard/net.c:98:13: warning: ‘iface_append_unicast’ defined but not used [-Wunused-function] static void iface_append_unicast(zval *unicast, zend_long flags, ^ *** Error code 1 I'll see if I can get them fixed in the next few days. Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/
  101168
November 27, 2017 17:51 pollita@php.net (Sara Golemon)
On Mon, Nov 27, 2017 at 12:23 PM, Matteo Beccati <php@beccati.com> wrote:
> I've just tested a NetBSD 7.0 i386 machine and I'm getting a few errors: > > ext/standard/net.c: At top level: > ext/standard/net.c:98:13: warning: ‘iface_append_unicast’ defined but > not used [-Wunused-function] > static void iface_append_unicast(zval *unicast, zend_long flags, > ^ > *** Error code 1 > Interesting, that tells me that getifaddrs() isn't available on your
system. I've pushed a fix for the include and the unused method, but I'll have to spin up a NetBSD VM to figure out a way to support the functionality on that platform. Thanks for testing! -Sara
  101167
November 27, 2017 17:30 ml@anderiasch.de (Florian Anderiasch)
On 27.11.2017 17:56, Sara Golemon wrote:
> On Mon, Nov 27, 2017 at 11:38 AM, Florian Anderiasch <ml@anderiasch.de> wrote: >> Somehow it doesn't match the >> +#if HAVE_NET_IF_H >> in net.c >> >> I had to unconditionally include it (for testing), otherwise >> IFF_BROADCAST and IFF_POINTOPOINT are undefined. (they are in >> sys/net/if.h on OpenBSD, but I only tested 6.2). >> > Can you send or gist your config.log? (Optionally redacted to the > net/if.h check if you want to do that yourself) > > Are you saying you simply removed the `#if HAVE_NET_IF_H` check? Or > that you did that *AND* changed the include directive to `#include > ` ? > >> Can do a proper bug report if needed, but maybe I get around to test >> NetBSD as well. >> > Thanks! >
Filed as https://bugs.php.net/bug.php?id=75582 - let's move the discussion over there, sorry for the noise. Greetings, Florian