summaryrefslogtreecommitdiff
path: root/net/l2tpd/files/patch-l2tpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/l2tpd/files/patch-l2tpd.c')
-rw-r--r--net/l2tpd/files/patch-l2tpd.c61
1 files changed, 58 insertions, 3 deletions
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.",