aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorkrion <krion@FreeBSD.org>2004-04-29 03:56:35 +0800
committerkrion <krion@FreeBSD.org>2004-04-29 03:56:35 +0800
commit6079c4879fa1e24a52faef680d2c746549fd3516 (patch)
tree70d03d71d149274462d389b07db4f4166aef84ef /net
parentb672a4c25b06f34250cc633621cfe8af6637caa5 (diff)
downloadfreebsd-ports-gnome-6079c4879fa1e24a52faef680d2c746549fd3516.tar.gz
freebsd-ports-gnome-6079c4879fa1e24a52faef680d2c746549fd3516.tar.zst
freebsd-ports-gnome-6079c4879fa1e24a52faef680d2c746549fd3516.zip
- Reflect changes on FreeBSD 5.* to load if_ppp.ko unless
already loaded. (Thx to zoleg at buryatia dot ru for pointing that) Current code will try both old and new method. - Fix build on amd64 - Reflect internal logf() for GCC 3-x - Reflect 32bitness of time in `struct lastlog'. PR: ports/65882 Submitted by: maintainer
Diffstat (limited to 'net')
-rw-r--r--net/pppd23/Makefile4
-rw-r--r--net/pppd23/files/extra-patch-no-logf9
-rw-r--r--net/pppd23/files/patch-ab57
3 files changed, 68 insertions, 2 deletions
diff --git a/net/pppd23/Makefile b/net/pppd23/Makefile
index e5cab87f1841..2145b0ec40cc 100644
--- a/net/pppd23/Makefile
+++ b/net/pppd23/Makefile
@@ -20,8 +20,8 @@ MANCOMPRESSED= yes
.include <bsd.port.pre.mk>
-.if ${ARCH} == "amd64"
-BROKEN= "Does not compile on amd64"
+.if ${OSVERSION} >= 500000
+EXTRA_PATCHES= ${PATCHDIR}/extra-patch-no-logf
.endif
.include <bsd.port.post.mk>
diff --git a/net/pppd23/files/extra-patch-no-logf b/net/pppd23/files/extra-patch-no-logf
new file mode 100644
index 000000000000..e77650a4ce6e
--- /dev/null
+++ b/net/pppd23/files/extra-patch-no-logf
@@ -0,0 +1,9 @@
+--- chat/Makefile.bsd.orig Thu Apr 22 15:16:08 2004
++++ chat/Makefile.bsd Thu Apr 22 15:16:35 2004
+@@ -5,4 +5,6 @@
+ MAN8= chat.8
+ BINDIR= /usr/sbin
+
++CFLAGS+= -fno-builtin-logf
++
+ .include <bsd.prog.mk>
diff --git a/net/pppd23/files/patch-ab b/net/pppd23/files/patch-ab
new file mode 100644
index 000000000000..ee67dc668dd2
--- /dev/null
+++ b/net/pppd23/files/patch-ab
@@ -0,0 +1,57 @@
+diff -rNu ./pppd/auth.c ../../work/ppp-2.3.11/pppd/auth.c
+--- ./pppd/auth.c Thu Dec 23 03:25:13 1999
++++ ../../work/ppp-2.3.11/pppd/auth.c Thu Apr 22 14:49:05 2004
+@@ -1137,7 +1137,7 @@
+ if ((fd = open(_PATH_LASTLOG, O_RDWR, 0)) >= 0) {
+ (void)lseek(fd, (off_t)(pw->pw_uid * sizeof(ll)), SEEK_SET);
+ memset((void *)&ll, 0, sizeof(ll));
+- (void)time(&ll.ll_time);
++ ll.ll_time = time(NULL);
+ (void)strncpy(ll.ll_line, tty, sizeof(ll.ll_line));
+ (void)write(fd, (char *)&ll, sizeof(ll));
+ (void)close(fd);
+diff -rNu ./pppd/sys-bsd.c ../../work/ppp-2.3.11/pppd/sys-bsd.c
+--- ./pppd/sys-bsd.c Thu Apr 22 14:48:03 2004
++++ ../../work/ppp-2.3.11/pppd/sys-bsd.c Thu Apr 22 14:53:59 2004
+@@ -182,6 +182,7 @@
+ int s, ok;
+ struct ifreq ifr;
+ extern char *no_ppp_msg;
++ const char* modname = "if_ppp";
+
+ if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+ return 1; /* can't tell */
+@@ -189,12 +190,18 @@
+ strlcpy(ifr.ifr_name, "ppp0", sizeof (ifr.ifr_name));
+ ok = ioctl(s, SIOCGIFFLAGS, (caddr_t) &ifr) >= 0;
+ close(s);
++ if (ok)
++ return 1;
++ if (modfind(modname) != -1)
++ return 1;
++ if (getuid() == 0 && kldload(modname) != -1)
++ return 1;
+
+ no_ppp_msg = "\
+ This system lacks kernel support for PPP. To include PPP support\n\
+-in the kernel, please follow the steps detailed in the README.bsd\n\
+-file in the ppp-2.2 distribution.\n";
+- return ok;
++in the kernel, please add \"device ppp\" to your kernel config or \n\
++load the if_ppp module.\n";
++ return 0;
+ }
+
+ /*
+diff -rNu ./pppd/utils.c ../../work/ppp-2.3.11/pppd/utils.c
+--- ./pppd/utils.c Sat Sep 11 14:35:47 1999
++++ ../../work/ppp-2.3.11/pppd/utils.c Thu Apr 22 14:49:50 2004
+@@ -249,7 +249,7 @@
+ break;
+ case 'r':
+ f = va_arg(args, char *);
+-#ifndef __powerpc__
++#if !defined(__powerpc__) && !defined(__amd64__)
+ n = vslprintf(buf, buflen + 1, f, va_arg(args, va_list));
+ #else
+ /* On the powerpc, a va_list is an array of 1 structure */