add cpmac ipv6 patch from mache
[openwrt.git] / openwrt / package / ppp / patches / 100-debian_close_dev_ppp.patch
1 From: Simon Peter <dn.tlp@gmx.net>
2 Subject: Bug#306261: pppd does not properly close /dev/ppp on persist
3
4 When using the kernel PPPoE driver, pppd never
5 closes /dev/ppp when the link has come down.
6
7 It opens superfluous fds to the device each time it re-opens the
8 connection, with the unclosed ones falsely reported always ready for
9 data by select().
10
11 This makes pppd eat up 100% CPU time after the first persist because of
12 the always instantly returning select() on the unclosed fds.
13
14 The problem also occurs with the upstream version, but does not occur
15 when a pty/tty device is used for the ppp connection.
16
17
18 diff -u -r ppp-2.4.3/pppd/sys-linux.c ppp-2.4.3/pppd/sys-linux.c
19 --- ppp-2.4.3/pppd/sys-linux.c 2005-04-29 20:08:37.000000000 +0200
20 +++ ppp-2.4.3/pppd/sys-linux.c 2005-04-29 20:07:03.000000000 +0200
21 @@ -455,6 +455,13 @@
22 if (new_style_driver) {
23 int flags;
24
25 + /* if a ppp_fd is already open, close it first */
26 + if(ppp_fd > 0) {
27 + close(ppp_fd);
28 + remove_fd(ppp_fd);
29 + ppp_fd = -1;
30 + }
31 +
32 /* Open an instance of /dev/ppp and connect the channel to it */
33 if (ioctl(fd, PPPIOCGCHAN, &chindex) == -1) {
34 error("Couldn't get channel number: %m");
This page took 0.045953 seconds and 5 git commands to generate.