diff options
author | Maxim Sobolev <sobomax@FreeBSD.org> | 2002-11-23 00:40:51 +0000 |
---|---|---|
committer | Maxim Sobolev <sobomax@FreeBSD.org> | 2002-11-23 00:40:51 +0000 |
commit | e88d2bd5b47c64553fd373fd8f0ac8222985051f (patch) | |
tree | 490af9c1c7fc2571cdd68c5e39a977cf8b2d3e5a | |
parent | Maintainer update to version 1.1 (diff) |
- Update to 0.69;
- fix an incompatibility, which causes daemon to eat 100% CPU even when
completely idle (ages old problem with select()'ing on FIFO without
writers opened for reading in non-blocking mode);
- replace incomplete and ugly daemonize code with native daemon(3).
Sponsored by: United Networks of Ukraine
-rw-r--r-- | net/l2tpd/Makefile | 6 | ||||
-rw-r--r-- | net/l2tpd/files/patch-doc::l2tp-secrets.5 | 2 | ||||
-rw-r--r-- | net/l2tpd/files/patch-doc::l2tpd.8 | 6 | ||||
-rw-r--r-- | net/l2tpd/files/patch-doc::l2tpd.conf.5 | 4 | ||||
-rw-r--r-- | net/l2tpd/files/patch-file.h | 4 | ||||
-rw-r--r-- | net/l2tpd/files/patch-l2tp.h | 19 | ||||
-rw-r--r-- | net/l2tpd/files/patch-l2tpd.c | 61 | ||||
-rw-r--r-- | net/l2tpd/pkg-plist | 6 |
8 files changed, 84 insertions, 24 deletions
diff --git a/net/l2tpd/Makefile b/net/l2tpd/Makefile index 9c1e7c0724db..f87141eb65b6 100644 --- a/net/l2tpd/Makefile +++ b/net/l2tpd/Makefile @@ -29,8 +29,8 @@ do-install: ${INSTALL_MAN} ${WRKSRC}/doc/l2tpd.8 ${PREFIX}/man/man8 ${INSTALL_MAN} ${WRKSRC}/doc/l2tp-secrets.5 ${PREFIX}/man/man5 ${INSTALL_MAN} ${WRKSRC}/doc/l2tpd.conf.5 ${PREFIX}/man/man5 - ${MKDIR} ${PREFIX}/etc/l2tpd - ${INSTALL_DATA} ${WRKSRC}/doc/l2tpd.conf.sample ${PREFIX}/etc/l2tpd - ${INSTALL_DATA} ${WRKSRC}/doc/l2tp-secrets.sample ${PREFIX}/etc/l2tpd + ${MKDIR} ${PREFIX}/etc/l2tp + ${INSTALL_DATA} ${WRKSRC}/doc/l2tpd.conf.sample ${PREFIX}/etc/l2tp + ${INSTALL_DATA} ${WRKSRC}/doc/l2tp-secrets.sample ${PREFIX}/etc/l2tp .include <bsd.port.mk> diff --git a/net/l2tpd/files/patch-doc::l2tp-secrets.5 b/net/l2tpd/files/patch-doc::l2tp-secrets.5 index ed1aed5846cf..6495713b7900 100644 --- a/net/l2tpd/files/patch-doc::l2tp-secrets.5 +++ b/net/l2tpd/files/patch-doc::l2tp-secrets.5 @@ -8,7 +8,7 @@ $FreeBSD$ .SH "FILES" -\fB\fR/etc/l2tp/l2tpd.conf \fB\fR/etc/l2tp/l2tp\-secrets -+\fB\fR%%PREFIX%%/etc/l2tpd/l2tpd.conf \fB\fR%%PREFIX%%/etc/l2tpd/l2tp\-secrets ++\fB\fR%%PREFIX%%/etc/l2tp/l2tpd.conf \fB\fR%%PREFIX%%/etc/l2tp/l2tp\-secrets \fB\fR/var/run/l2tp\-control .SH "BUGS" diff --git a/net/l2tpd/files/patch-doc::l2tpd.8 b/net/l2tpd/files/patch-doc::l2tpd.8 index f003758a4c18..da6d31397b2c 100644 --- a/net/l2tpd/files/patch-doc::l2tpd.8 +++ b/net/l2tpd/files/patch-doc::l2tpd.8 @@ -8,13 +8,13 @@ $FreeBSD$ .B -c <config file> Tells l2tpd to use an alternate config file. Default is -/etc/l2tpd/l2tpd.conf -+%%PREFIX%%/etc/l2tpd/l2tpd.conf ++%%PREFIX%%/etc/l2tp/l2tpd.conf .TP .B -s <secret file> Tells l2tpd to use an alternate "secrets" file. Default is -/etc/l2tpd/l2tp-secrets -+%%PREFIX%%/etc/l2tpd/l2tp-secrets ++%%PREFIX%%/etc/l2tp/l2tp-secrets .TP .B -p <pid file> @@ -23,7 +23,7 @@ $FreeBSD$ .SH "FILES" -\fB\fR/etc/l2tp/l2tpd.conf \fB\fR/etc/l2tp/l2tp\-secrets -+\fB\fR%%PREFIX%%/etc/l2tpd/l2tpd.conf \fB\fR%%PREFIX%%/etc/l2tpd/l2tp\-secrets ++\fB\fR%%PREFIX%%/etc/l2tp/l2tpd.conf \fB\fR%%PREFIX%%/etc/l2tp/l2tp\-secrets \fB\fR/var/run/l2tp\-control .SH "BUGS" diff --git a/net/l2tpd/files/patch-doc::l2tpd.conf.5 b/net/l2tpd/files/patch-doc::l2tpd.conf.5 index b0f3ad7e5767..21a73aeb8103 100644 --- a/net/l2tpd/files/patch-doc::l2tpd.conf.5 +++ b/net/l2tpd/files/patch-doc::l2tpd.conf.5 @@ -8,7 +8,7 @@ $FreeBSD$ .B auth file Specify where to find the authentication file used to authenticate -l2tp tunnels. The default is /etc/l2tp/l2tp\-secrets. -+l2tp tunnels. The default is %%PREFIX%%/etc/l2tpd/l2tp\-secrets. ++l2tp tunnels. The default is %%PREFIX%%/etc/l2tp/l2tp\-secrets. .TP .B Port @@ -17,7 +17,7 @@ $FreeBSD$ .SH "FILES" -\fB\fR/etc/l2tp/l2tpd.conf \fB\fR/etc/l2tp/l2tp\-secrets -+\fB\fR%%PREFIX%%/etc/l2tpd/l2tpd.conf \fB\fR%%PREFIX%%/etc/l2tpd/l2tp\-secrets ++\fB\fR%%PREFIX%%/etc/l2tp/l2tpd.conf \fB\fR%%PREFIX%%/etc/l2tp/l2tp\-secrets \fB\fR/var/run/l2tp\-control .SH "BUGS" diff --git a/net/l2tpd/files/patch-file.h b/net/l2tpd/files/patch-file.h index 819c7d932e45..f2c68b6ac00d 100644 --- a/net/l2tpd/files/patch-file.h +++ b/net/l2tpd/files/patch-file.h @@ -11,9 +11,9 @@ $FreeBSD$ -#define ALT_DEFAULT_AUTH_FILE "/etc/l2tpd/l2tp-secrets" -#define DEFAULT_CONFIG_FILE "/etc/l2tp/l2tpd.conf" -#define ALT_DEFAULT_CONFIG_FILE "/etc/l2tpd/l2tpd.conf" -+#define DEFAULT_AUTH_FILE (PREFIX "/etc/l2tpd/l2tp-secrets") ++#define DEFAULT_AUTH_FILE (PREFIX "/etc/l2tp/l2tp-secrets") +#define ALT_DEFAULT_AUTH_FILE (PREFIX "/etc/l2tpd/l2tp-secrets") -+#define DEFAULT_CONFIG_FILE (PREFIX "/etc/l2tpd/l2tpd.conf") ++#define DEFAULT_CONFIG_FILE (PREFIX "/etc/l2tp/l2tpd.conf") +#define ALT_DEFAULT_CONFIG_FILE (PREFIX "/etc/l2tpd/l2tpd.conf") #define DEFAULT_PID_FILE "/var/run/l2tpd.pid" diff --git a/net/l2tpd/files/patch-l2tp.h b/net/l2tpd/files/patch-l2tp.h index f94776599055..51ab145fc311 100644 --- a/net/l2tpd/files/patch-l2tp.h +++ b/net/l2tpd/files/patch-l2tp.h @@ -1,11 +1,8 @@ - -$FreeBSD$ - ---- l2tp.h.orig Tue Jan 15 18:59:27 2002 -+++ l2tp.h Tue Oct 22 12:42:08 2002 -@@ -20,7 +20,10 @@ +--- l2tp.h.orig Mon Aug 19 20:26:23 2002 ++++ l2tp.h Tue Nov 12 13:00:09 2002 +@@ -21,7 +21,10 @@ - #define MAXSTRLEN 120 /* Maximum length of common strings */ + #define MAXSTRLEN 120 /* Maximum length of common strings */ +#include <sys/types.h> +#include <sys/socket.h> @@ -14,3 +11,11 @@ $FreeBSD$ #include <termios.h> #include "osport.h" #include "scheduler.h" +@@ -211,6 +214,7 @@ + extern int ppd; + extern int switch_io; /* jz */ + extern int control_fd; ++extern int control_fdw; + extern int start_pppd (struct call *c, struct ppp_opts *); + extern void magic_lac_dial (void *); + extern int get_entropy (char *, int); diff --git a/net/l2tpd/files/patch-l2tpd.c b/net/l2tpd/files/patch-l2tpd.c index 32d0f625ac1e..b33d17613ce2 100644 --- a/net/l2tpd/files/patch-l2tpd.c +++ b/net/l2tpd/files/patch-l2tpd.c @@ -1,9 +1,9 @@ $FreeBSD$ ---- l2tpd.c.orig Fri Jan 11 17:54:44 2002 -+++ l2tpd.c Tue Oct 22 12:43:45 2002 -@@ -33,8 +33,6 @@ +--- l2tpd.c.orig Mon Aug 19 17:12:17 2002 ++++ l2tpd.c Sat Nov 23 02:02:04 2002 +@@ -34,8 +34,6 @@ #include <netdb.h> #include <string.h> #include <fcntl.h> @@ -12,3 +12,58 @@ $FreeBSD$ #ifdef USE_KERNEL #include <sys/ioctl.h> #endif +@@ -46,6 +44,7 @@ + struct utsname uts; + int ppd = 1; /* Packet processing delay */ + int control_fd; /* descriptor of control area */ ++int control_fdw; /* descriptor of control area */ + char *args; + + char *dial_no_tmp; /* jz: Dialnumber for Outgoing Call */ +@@ -384,6 +383,7 @@ + + /* close the control pipe fd */ + close (control_fd); ++ close (control_fdw); + + execv (PPPD, stropt); + log (LOG_WARN, "%s: Exec of %s failed!\n", __FUNCTION__, PPPD); +@@ -920,7 +920,9 @@ + } + /* Otherwise select goes nuts */ + close (control_fd); ++ close (control_fdw); + control_fd = open (CONTROL_PIPE, O_RDONLY | O_NONBLOCK, 0600); ++ control_fdw = open (CONTROL_PIPE, O_WRONLY | O_NONBLOCK, 0600); + } + + void usage(void) { +@@ -985,6 +987,7 @@ + char buf[STRLEN]; + int pidfilewritten=0; + ++#ifndef __FreeBSD__ + if((pid = fork()) < 0) { + log(LOG_LOG, "%s: Unable to fork ()\n",__FUNCTION__); + close(server_socket); +@@ -998,6 +1001,12 @@ + to do a proper fix for this */ + close(1); + close(2); ++#else ++ if (daemon(0, 0) != 0) { ++ log(LOG_LOG, "%s: daemon () failed\n", __FUNCTION__); ++ exit(1); ++ } ++#endif + + /* Read previous pid file. */ + if ((i = open(gconfig.pidfile,O_RDONLY)) > 0) { +@@ -1075,6 +1084,7 @@ + init_scheduler (); + mkfifo (CONTROL_PIPE, 0600); + control_fd = open (CONTROL_PIPE, O_RDONLY | O_NONBLOCK, 0600); ++ control_fdw = open (CONTROL_PIPE, O_WRONLY | O_NONBLOCK, 0600); + if (control_fd < 0) + { + log (LOG_CRIT, "%s: Unable to open " CONTROL_PIPE " for reading.", diff --git a/net/l2tpd/pkg-plist b/net/l2tpd/pkg-plist index 5c702f3b9a6e..17b1d761dae8 100644 --- a/net/l2tpd/pkg-plist +++ b/net/l2tpd/pkg-plist @@ -1,6 +1,6 @@ bin/l2tpd -etc/l2tpd/l2tp-secrets.sample -etc/l2tpd/l2tpd.conf.sample +etc/l2tp/l2tp-secrets.sample +etc/l2tp/l2tpd.conf.sample share/doc/l2tpd/README @dirrm share/doc/l2tpd -@dirrm etc/l2tpd +@dirrm etc/l2tp |