head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.6 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.4 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.2 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q3:1.1.0.36 pkgsrc-2011Q3-base:1.1 pkgsrc-2011Q2:1.1.0.34 pkgsrc-2011Q2-base:1.1 pkgsrc-2011Q1:1.1.0.32 pkgsrc-2011Q1-base:1.1 pkgsrc-2010Q4:1.1.0.30 pkgsrc-2010Q4-base:1.1 pkgsrc-2010Q3:1.1.0.28 pkgsrc-2010Q3-base:1.1 pkgsrc-2010Q2:1.1.0.26 pkgsrc-2010Q2-base:1.1 pkgsrc-2010Q1:1.1.0.24 pkgsrc-2010Q1-base:1.1 pkgsrc-2009Q4:1.1.0.22 pkgsrc-2009Q4-base:1.1 pkgsrc-2009Q3:1.1.0.20 pkgsrc-2009Q3-base:1.1 pkgsrc-2009Q2:1.1.0.18 pkgsrc-2009Q2-base:1.1 pkgsrc-2009Q1:1.1.0.16 pkgsrc-2009Q1-base:1.1 pkgsrc-2008Q4:1.1.0.14 pkgsrc-2008Q4-base:1.1 pkgsrc-2008Q3:1.1.0.12 pkgsrc-2008Q3-base:1.1 cube-native-xorg:1.1.0.10 cube-native-xorg-base:1.1 pkgsrc-2008Q2:1.1.0.8 pkgsrc-2008Q2-base:1.1 cwrapper:1.1.0.6 pkgsrc-2008Q1:1.1.0.4 pkgsrc-2008Q1-base:1.1 pkgsrc-2007Q4:1.1.0.2 pkgsrc-2007Q4-base:1.1; locks; strict; comment @# @; 1.2 date 2011.12.16.11.05.25; author asau; state dead; branches; next 1.1; 1.1 date 2007.12.21.17.32.27; author drochner; state Exp; branches; next ; desc @@ 1.2 log @Update to Samba 3.5.11 from net/samba35, part of Samba packages rearrangement. @ text @$NetBSD: patch-da,v 1.1 2007/12/21 17:32:27 drochner Exp $ --- lib/interfaces.c.orig 2007-03-01 05:54:30.000000000 +0100 +++ lib/interfaces.c @@@@ -343,6 +343,42 @@@@ static int _get_interfaces(struct iface_ #define _FOUND_IFACE_ANY #endif /* HAVE_IFACE_AIX */ +#ifdef HAVE_IFACE_IFADDRS + +#include + +static int _get_interfaces(struct iface_struct *ifaces, int max_interfaces) +{ + struct ifaddrs *ia; + int total; + + if (getifaddrs(&ia) < 0) + return -1; + + total = 0; + while (ia && total < max_interfaces) { + if (ia->ifa_addr->sa_family != AF_INET || + !(ia->ifa_flags & IFF_UP)) { + ia = ia->ifa_next; + continue; + } + strncpy(ifaces[total].name, ia->ifa_name, + sizeof(ifaces[total].name) - 1); + ifaces[total].name[sizeof(ifaces[total].name) - 1] = 0; + ifaces[total].ip = ((struct sockaddr_in *)(ia->ifa_addr)) + ->sin_addr; + ifaces[total].netmask = ((struct sockaddr_in *)(ia->ifa_netmask)) + ->sin_addr; + total++; + ia = ia->ifa_next; + } + + freeifaddrs(ia); + return total; +} + +#define _FOUND_IFACE_ANY +#endif /* HAVE_IFACE_IFADDRS */ #ifndef _FOUND_IFACE_ANY static int _get_interfaces(struct iface_struct *ifaces, int max_interfaces) { @ 1.1 log @fix the problems with SIOCGIFCONF and its wrong use here by adding a getifaddrs-based implementation, fix another botch in the patch for "configure", bump PKGREVISION @ text @d1 1 a1 1 $NetBSD$ @