From 4dfe768eebd48e6f40b8c9d9d39c105e5f7a17a3 Mon Sep 17 00:00:00 2001 From: jperkin Date: Thu, 4 Apr 2013 12:38:59 +0000 Subject: Pull in fixes from upstream for interface enumeration, fixes segfault on SunOS. Bump PKGREVISION. --- net/dnsmasq/Makefile | 3 ++- net/dnsmasq/distinfo | 3 ++- net/dnsmasq/patches/patch-src_bpf.c | 27 +++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 net/dnsmasq/patches/patch-src_bpf.c (limited to 'net/dnsmasq') diff --git a/net/dnsmasq/Makefile b/net/dnsmasq/Makefile index ca0a9d9d59d..9aea249ba4e 100644 --- a/net/dnsmasq/Makefile +++ b/net/dnsmasq/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.20 2012/12/06 12:24:04 roy Exp $ +# $NetBSD: Makefile,v 1.21 2013/04/04 12:38:59 jperkin Exp $ # DISTNAME= dnsmasq-2.64 +PKGREVISION= 1 CATEGORIES= net MASTER_SITES= http://www.thekelleys.org.uk/dnsmasq/ LICENSE= gnu-gpl-v3 diff --git a/net/dnsmasq/distinfo b/net/dnsmasq/distinfo index f85af46a08c..89c05c8f289 100644 --- a/net/dnsmasq/distinfo +++ b/net/dnsmasq/distinfo @@ -1,5 +1,6 @@ -$NetBSD: distinfo,v 1.17 2012/12/06 12:24:04 roy Exp $ +$NetBSD: distinfo,v 1.18 2013/04/04 12:38:59 jperkin Exp $ SHA1 (dnsmasq-2.64.tar.gz) = 48368c2a4d75110d4b2d40d1ba6a821e7b3c1b0b RMD160 (dnsmasq-2.64.tar.gz) = 84e5464259f7c697aec3adc199f9af462ef63fb9 Size (dnsmasq-2.64.tar.gz) = 536724 bytes +SHA1 (patch-src_bpf.c) = 4342823f90ad848d5cfef07ea6d82165676c1d64 diff --git a/net/dnsmasq/patches/patch-src_bpf.c b/net/dnsmasq/patches/patch-src_bpf.c new file mode 100644 index 00000000000..4b7719e6acc --- /dev/null +++ b/net/dnsmasq/patches/patch-src_bpf.c @@ -0,0 +1,27 @@ +$NetBSD: patch-src_bpf.c,v 1.1 2013/04/04 12:38:59 jperkin Exp $ + +Pull in upstream fixes for interface enumeration. + +--- src/bpf.c.orig 2012-12-03 14:05:59.000000000 +0000 ++++ src/bpf.c +@@ -111,7 +111,7 @@ int iface_enumerate(int family, void *pa + { + int iface_index = if_nametoindex(addrs->ifa_name); + +- if (iface_index == 0) ++ if (iface_index == 0 || !addrs->ifa_addr || !addrs->ifa_netmask) + continue; + + if (family == AF_INET) +@@ -119,7 +119,10 @@ int iface_enumerate(int family, void *pa + struct in_addr addr, netmask, broadcast; + addr = ((struct sockaddr_in *) addrs->ifa_addr)->sin_addr; + netmask = ((struct sockaddr_in *) addrs->ifa_netmask)->sin_addr; +- broadcast = ((struct sockaddr_in *) addrs->ifa_broadaddr)->sin_addr; ++ if (addrs->ifa_broadaddr) ++ broadcast = ((struct sockaddr_in *) addrs->ifa_broadaddr)->sin_addr; ++ else ++ broadcast.s_addr = 0; + if (!((*callback)(addr, iface_index, netmask, broadcast, parm))) + goto err; + } -- cgit v1.2.3