1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-25 04:43:33 +00:00

- 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
This commit is contained in:
Maxim Sobolev 2002-11-23 00:40:51 +00:00
parent 4f9adee25e
commit e88d2bd5b4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=70796
8 changed files with 84 additions and 24 deletions

View File

@ -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>

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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);

View File

@ -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.",

View File

@ -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