summaryrefslogtreecommitdiff
path: root/package/l2tpd/patches
diff options
context:
space:
mode:
authornico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-04-07 00:00:41 +0000
committernico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-04-07 00:00:41 +0000
commit70e6d4417483803e1318e20e432d1f10c820b911 (patch)
treeb2963fffa8f0ff9e292ca0939e65ccb773e60047 /package/l2tpd/patches
parent6ecb6bdbed9e35706c2f584fab7675aaa32b8d34 (diff)
Fix l2tpd blocking on read from ppp childs (closes: #455)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@3597 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/l2tpd/patches')
-rw-r--r--package/l2tpd/patches/04-nonblock.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/package/l2tpd/patches/04-nonblock.patch b/package/l2tpd/patches/04-nonblock.patch
new file mode 100644
index 0000000000..7fc2226acd
--- /dev/null
+++ b/package/l2tpd/patches/04-nonblock.patch
@@ -0,0 +1,26 @@
+--- l2tpd-0.70-pre20031121.orig/l2tpd.c.orig 2006-04-05 13:28:36.000000000 +0100
++++ l2tpd-0.70-pre20031121.orig/l2tpd.c 2006-04-05 13:33:39.000000000 +0100
+@@ -289,6 +289,8 @@
+ #endif
+ struct termios ptyconf;
+ char *str;
++ int flags;
++
+ p = opts;
+ stropt[0] = strdup (PPPD);
+ while (p)
+@@ -347,6 +349,14 @@
+ close(c->fd);
+ return -EINVAL;
+ }
++ flags = fcntl(c->fd, F_GETFL);
++ if (flags < 0 || fcntl(c->fd, F_SETFL, flags | O_NONBLOCK) < 0)
++ {
++ log (LOG_WARN, "%s: unable to fcntl(O_NONBLOCK) on pty\n",
++ __FUNCTION__);
++ close(c->fd);
++ return -EINVAL;
++ }
+ tty = ptsname(c->fd);
+ if (tty == NULL)
+ {