head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.12 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.10 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.8 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q2:1.2.0.6 pkgsrc-2011Q2-base:1.2 pkgsrc-2009Q4:1.2.0.4 pkgsrc-2009Q4-base:1.2 pkgsrc-2008Q4:1.2.0.2 pkgsrc-2008Q4-base:1.2; locks; strict; comment @# @; 1.2 date 2008.12.19.07.53.43; author roy; state dead; branches; next 1.1; 1.1 date 2008.11.22.18.59.54; author ahoka; state Exp; branches; next ; desc @@ 1.2 log @Update to dnsmasq-2.46 Noteable changes include: NetBSD-5 support Optional DBus and IPv6 support ISC leasefile support removed Support DHCP clients in multiple DNS domains Re-read /etc/resolv.conf when an "interface up" event occurs @ text @--- src/bpf.c 2008-11-18 14:01:26.000000000 +0000 +++ src/bpf.c 2008-11-18 14:09:21.000000000 +0000 @@@@ -30,7 +30,7 @@@@ int iface_enumerate(void *parm, int (*ipv4_callback)(), int (*ipv6_callback)()) { - char *ptr; + char *ptr, *end; struct ifreq *ifr; struct ifconf ifc; int fd, errsav, ret = 0; @@@@ -62,16 +62,20 @@@@ lastlen = ifc.ifc_len; } } - - for (ptr = ifc.ifc_buf; ptr < ifc.ifc_buf + ifc.ifc_len; ptr += len ) + + end = ifc.ifc_buf + ifc.ifc_len; + for (ptr = ifc.ifc_buf; ptr < end; ptr += len) { /* subsequent entries may not be aligned, so copy into an aligned buffer to avoid nasty complaints about unaligned accesses. */ #ifdef HAVE_SOCKADDR_SA_LEN - len = ((struct ifreq *)ptr)->ifr_addr.sa_len + offsetof(struct ifreq, ifr_ifru); + ifr = (struct ifreq *)ptr; + if (ifr->ifr_addr.sa_len > sizeof(ifr->ifr_ifru)) + len = ifr->ifr_addr.sa_len + offsetof(struct ifreq, ifr_ifru); + else #else - len = sizeof(struct ifreq); + len = sizeof(struct ifreq); #endif if (!expand_buf(&ifreq, len)) goto err; @ 1.1 log @Add missed file in previous commit. @ text @@