summaryrefslogtreecommitdiff
path: root/net/rp-pppoe
diff options
context:
space:
mode:
authoris <is@pkgsrc.org>2012-08-23 13:10:52 +0000
committeris <is@pkgsrc.org>2012-08-23 13:10:52 +0000
commit1363f6c4be0dc504218d76a7b2c1a02a597212d2 (patch)
tree1c3379d10cfb6c76b1e56f270651b2b428e4ea3f /net/rp-pppoe
parentdb7bf85443dbc4f9a51ca8dc78ed74468f9649e7 (diff)
downloadpkgsrc-1363f6c4be0dc504218d76a7b2c1a02a597212d2.tar.gz
rp-pppoe couldn't find the interfaces' Ethernet address with the old
code, as this used the NetBSD<5-style variable effective ifreq length. The patched code works in old and new compilation environments. Patch optimized by gimpy@.
Diffstat (limited to 'net/rp-pppoe')
-rw-r--r--net/rp-pppoe/Makefile4
-rw-r--r--net/rp-pppoe/distinfo4
-rw-r--r--net/rp-pppoe/patches/patch-ai34
3 files changed, 34 insertions, 8 deletions
diff --git a/net/rp-pppoe/Makefile b/net/rp-pppoe/Makefile
index 88222b525b2..88f17d58fcd 100644
--- a/net/rp-pppoe/Makefile
+++ b/net/rp-pppoe/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.39 2010/02/19 18:41:39 joerg Exp $
+# $NetBSD: Makefile,v 1.40 2012/08/23 13:10:52 is Exp $
DISTNAME= rp-pppoe-3.8
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= net
MASTER_SITES= http://www.roaringpenguin.com/files/download/
diff --git a/net/rp-pppoe/distinfo b/net/rp-pppoe/distinfo
index 6feb5025fda..21af8bf7b8e 100644
--- a/net/rp-pppoe/distinfo
+++ b/net/rp-pppoe/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.11 2006/11/01 15:17:13 martin Exp $
+$NetBSD: distinfo,v 1.12 2012/08/23 13:10:52 is Exp $
SHA1 (rp-pppoe-3.8.tar.gz) = d9a4346701e580b4a6049a940557b38533f9e8f7
RMD160 (rp-pppoe-3.8.tar.gz) = 039798154acae9e7a066172f23904d766ba68a9a
@@ -8,4 +8,4 @@ SHA1 (patch-ab) = a3b409352334ca11c9716a864404ccce90511051
SHA1 (patch-af) = a44803519081769250af1f15d64cfd9a9b3834ca
SHA1 (patch-ag) = 6ee706683df96ff7fb0aa5a93626265c2177d543
SHA1 (patch-ah) = 35cf47b00ad6df122de6e84f36eb844201c0d16b
-SHA1 (patch-ai) = 81568491692492c3ee564199882247004c4c47d7
+SHA1 (patch-ai) = d9cbe1ab1cab0932e5d598fbcd6e57b887239d1c
diff --git a/net/rp-pppoe/patches/patch-ai b/net/rp-pppoe/patches/patch-ai
index c244e625c87..21d99b556e6 100644
--- a/net/rp-pppoe/patches/patch-ai
+++ b/net/rp-pppoe/patches/patch-ai
@@ -1,8 +1,8 @@
-$NetBSD: patch-ai,v 1.1 2006/11/01 15:17:14 martin Exp $
+$NetBSD: patch-ai,v 1.2 2012/08/23 13:10:52 is Exp $
---- src/if.c.orig 2006-04-02 16:29:42.000000000 +0200
-+++ src/if.c 2006-11-01 12:15:52.000000000 +0100
-@@ -99,7 +99,7 @@
+--- src/if.c.orig 2006-04-02 14:29:42.000000000 +0000
++++ src/if.c
+@@ -99,7 +99,7 @@ static int dl_addrlen;
static unsigned char *bpfBuffer; /* Packet filter buffer */
static int bpfLength = 0; /* Packet filter buffer length */
@@ -11,3 +11,29 @@ $NetBSD: patch-ai,v 1.1 2006/11/01 15:17:14 martin Exp $
static int bpfOffset = 0; /* Current offset in bpfBuffer */
#endif
+@@ -152,7 +152,7 @@ getHWaddr(int sock, char const *ifname,
+ const struct sockaddr_dl *sdl;
+ struct ifconf ifc;
+ struct ifreq ifreq, *ifr;
+- int i;
++ int i,l;
+ int found = 0;
+
+ ifc.ifc_len = sizeof(inbuf);
+@@ -164,10 +164,12 @@ getHWaddr(int sock, char const *ifname,
+ ifreq.ifr_name[0] = '\0';
+ for (i = 0; i < ifc.ifc_len; ) {
+ ifr = (struct ifreq *)((caddr_t)ifc.ifc_req + i);
+- i += sizeof(ifr->ifr_name) +
+- (ifr->ifr_addr.sa_len > sizeof(struct sockaddr)
+- ? ifr->ifr_addr.sa_len
+- : sizeof(struct sockaddr));
++
++ l = sizeof(*ifr);
++ if (sizeof(ifr->ifr_name) + ifr->ifr_addr.sa_len > l)
++ l = sizeof(ifr->ifr_name) + ifr->ifr_addr.sa_len;
++ i += l;
++
+ if (ifr->ifr_addr.sa_family == AF_LINK) {
+ sdl = (const struct sockaddr_dl *) &ifr->ifr_addr;
+ if ((sdl->sdl_type == IFT_ETHER) &&