1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-17 03:25:46 +00:00
freebsd-ports/net/pppd23/files/patch-ab
Kirill Ponomarev 3699f82b18 - 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
2004-04-28 19:56:35 +00:00

58 lines
2.0 KiB
Plaintext

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 */