pkgsrc/net/p5-IO-Interface/patches/patch-aa
he 960cc61963 Update p5-IO-Interface from 1.03 to 1.05. Changes:
1.05    Fri Jun  6 11:53:21 EDT 2008
        Fix from Mitsuru Yoshida to compile on FreeBSD.

1.04	Wed Dec 26 13:38:53 EST 2007
	Fix from John Lightsey to avoid dmesg warnings on BSD systems.

Also need a local patch because NetBSD doesn't set the address family
on the "netmask" address, apparently this originates from ifconfig.
Work around that by just setting the address family field after ioctl()
and before checking it...
2008-07-14 18:13:16 +00:00

14 lines
518 B
Text

$NetBSD: patch-aa,v 1.1 2008/07/14 18:13:16 he Exp $
--- Interface.xs.orig 2008-06-06 17:51:42.000000000 +0200
+++ Interface.xs
@@ -511,6 +511,9 @@ if_netmask(sock, name, ...)
operation = SIOCGIFNETMASK;
}
if (!Ioctl(sock,operation,&ifr)) XSRETURN_UNDEF;
+#ifdef __NetBSD__
+ ifr.ifr_addr.sa_family = AF_INET;
+#endif
if (ifr.ifr_addr.sa_family != AF_INET) croak ("Address is not in the AF_INET family.\n");
RETVAL = inet_ntoa(((struct sockaddr_in*) &ifr.ifr_addr)->sin_addr);
#endif