head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.2 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.1.1.1.0.10 pkgsrc-2012Q4-base:1.1.1.1 pkgsrc-2012Q3:1.1.1.1.0.8 pkgsrc-2012Q3-base:1.1.1.1 pkgsrc-2012Q2:1.1.1.1.0.6 pkgsrc-2012Q2-base:1.1.1.1 pkgsrc-2012Q1:1.1.1.1.0.4 pkgsrc-2012Q1-base:1.1.1.1 pkgsrc-2011Q4:1.1.1.1.0.2 pkgsrc-2011Q4-base:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.2 date 2013.02.05.07.45.39; author wiz; state dead; branches; next 1.1; 1.1 date 2011.12.15.22.23.24; author asau; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2011.12.15.22.23.24; author asau; state Exp; branches; next ; desc @@ 1.2 log @Remove samba30 and samba33, as stated by Aleksej Saushev on Jul 7, 2012. @ text @$NetBSD: patch-da,v 1.1 2011/12/15 22:23:24 asau 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 @Initial revision @ text @d1 1 a1 1 $NetBSD: patch-da,v 1.1 2007/12/21 17:32:27 drochner Exp $ @ 1.1.1.1 log @Reimport Samba 3.0.37 from net/samba as net/samba30 as part of Samba packages rotation. @ text @@