summaryrefslogtreecommitdiff
path: root/net/pppd
diff options
context:
space:
mode:
authorcube <cube@pkgsrc.org>2005-01-02 17:26:09 +0000
committercube <cube@pkgsrc.org>2005-01-02 17:26:09 +0000
commit63d95ff6afd8d5ca3054b849779a6886d4bafa33 (patch)
tree9e3befbf2eb9ad1cef24366eb338a7164b6b4b78 /net/pppd
parent17e0a06d53859d650c32e1beab6eef9b5069597c (diff)
downloadpkgsrc-63d95ff6afd8d5ca3054b849779a6886d4bafa33.tar.gz
Add our revision 1.50 of sys-bsd.c that I had forgotten. It adds support
for cloning ppp(4) as found in -current.
Diffstat (limited to 'net/pppd')
-rw-r--r--net/pppd/distinfo4
-rw-r--r--net/pppd/patches/patch-az49
2 files changed, 39 insertions, 14 deletions
diff --git a/net/pppd/distinfo b/net/pppd/distinfo
index 0cb623a40bf..8adfbfa059b 100644
--- a/net/pppd/distinfo
+++ b/net/pppd/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.1.1.1 2005/01/02 02:51:41 cube Exp $
+$NetBSD: distinfo,v 1.2 2005/01/02 17:26:09 cube Exp $
SHA1 (ppp-2.4.3.tar.gz) = 5e2789f4dedc81943fa9f94c840cccc2407056f7
Size (ppp-2.4.3.tar.gz) = 688092 bytes
@@ -27,7 +27,7 @@ SHA1 (patch-av) = 6ae49e8f2d5d74fa437e100b27a021451feb8f28
SHA1 (patch-aw) = 7fb53f72216ffe34720b76fc122e87f4762a6696
SHA1 (patch-ax) = 3641654b6b158ad65e9dd95247836fa8c07ec66e
SHA1 (patch-ay) = 93ccd90f6efa58bfe31105526499308ed35b9522
-SHA1 (patch-az) = 250ce38e56be6e05719463c5a93b4b8acae78a43
+SHA1 (patch-az) = acd7680ccc537edf9e163d568ab0611fd762d747
SHA1 (patch-ba) = 4293edb8b490fe31e07268a6d7001e1c9db8f323
SHA1 (patch-bb) = 9b17b12b45d9857eea42c2a6dc3704392c4df7c0
SHA1 (patch-bc) = d53a2226166e84fa9ea049cdbfb52c1dcd0f1ed9
diff --git a/net/pppd/patches/patch-az b/net/pppd/patches/patch-az
index 3e5d9c56ee8..7141805c359 100644
--- a/net/pppd/patches/patch-az
+++ b/net/pppd/patches/patch-az
@@ -1,9 +1,9 @@
-$NetBSD: patch-az,v 1.1.1.1 2005/01/02 02:51:43 cube Exp $
+$NetBSD: patch-az,v 1.2 2005/01/02 17:26:09 cube Exp $
---- pppd/sys-bsd.c.orig 2004-12-31 23:51:00.000000000 +0100
+--- pppd/sys-bsd.c.orig 2005-01-02 17:58:02.000000000 +0100
+++ pppd/sys-bsd.c
-@@ -0,0 +1,2147 @@
-+/* NetBSD: sys-bsd.c,v 1.49 2004/02/28 19:27:49 itojun Exp */
+@@ -0,0 +1,2172 @@
++/* NetBSD: sys-bsd.c,v 1.50 2004/12/05 04:16:22 christos Exp */
+
+/*
+ * sys-bsd.c - System-dependent procedures for setting up
@@ -84,7 +84,7 @@ $NetBSD: patch-az,v 1.1.1.1 2005/01/02 02:51:43 cube Exp $
+#if 0
+#define RCSID "Id: sys-bsd.c,v 1.47 2000/04/13 12:04:23 paulus Exp "
+#else
-+__RCSID("NetBSD: sys-bsd.c,v 1.49 2004/02/28 19:27:49 itojun Exp ");
++__RCSID("NetBSD: sys-bsd.c,v 1.50 2004/12/05 04:16:22 christos Exp ");
+#endif
+#endif
+
@@ -296,16 +296,41 @@ $NetBSD: patch-az,v 1.1.1.1 2005/01/02 02:51:43 cube Exp $
+int
+ppp_available()
+{
-+ int s, ok;
-+ struct ifreq ifr;
++ struct if_clonereq ifcr;
++ char *cp, *buf;
++ int idx, s;
+ extern char *no_ppp_msg;
+
++ (void)memset(&ifcr, 0, sizeof(ifcr));
++
+ if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
-+ return 1; /* can't tell */
++ fatal("socket: %m");
++
++ if (ioctl(s, SIOCIFGCLONERS, &ifcr) == -1)
++ fatal("ioctl(get cloners): %m");
++
++ buf = malloc(ifcr.ifcr_total * IFNAMSIZ);
++ if (buf == NULL)
++ fatal("Unable to allocate cloner name buffer: %m");
++
++ ifcr.ifcr_count = ifcr.ifcr_total;
++ ifcr.ifcr_buffer = buf;
++
++ if (ioctl(s, SIOCIFGCLONERS, &ifcr) == -1)
++ fatal("ioctl(get cloners): %m");
++ (void)close(s);
+
-+ strlcpy(ifr.ifr_name, "ppp0", sizeof (ifr.ifr_name));
-+ ok = ioctl(s, SIOCGIFFLAGS, (caddr_t) &ifr) >= 0;
-+ close(s);
++ /*
++ * In case some disappeared in the mean time, clamp it down.
++ */
++ if (ifcr.ifcr_count > ifcr.ifcr_total)
++ ifcr.ifcr_count = ifcr.ifcr_total;
++
++ for (cp = buf, idx = 0; idx < ifcr.ifcr_count; idx++, cp += IFNAMSIZ) {
++ if (strcmp(cp, "ppp") == 0)
++ break;
++ }
++ free(buf);
+
+#ifdef __NetBSD__
+ no_ppp_msg = "\
@@ -317,7 +342,7 @@ $NetBSD: patch-az,v 1.1.1.1 2005/01/02 02:51:43 cube Exp $
+in the kernel, please follow the steps detailed in the README.bsd\n\
+file in the ppp-2.2 distribution.\n";
+#endif
-+ return ok;
++ return idx != ifcr.ifcr_count;
+}
+
+/*