1 From: Simon Peter <dn.tlp@gmx.net>
2 Subject: Bug#306261: pppd does not properly close /dev/ppp on persist
4 When using the kernel PPPoE driver, pppd never
5 closes /dev/ppp when the link has come down.
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
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.
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.
18 Index: ppp-2.4.3/pppd/sys-linux.c
19 ===================================================================
20 --- ppp-2.4.3.orig/pppd/sys-linux.c 2007-06-04 13:22:08.527558896 +0200
21 +++ ppp-2.4.3/pppd/sys-linux.c 2007-06-04 13:22:08.807516336 +0200
23 if (new_style_driver) {
26 + /* if a ppp_fd is already open, close it first */
33 /* Open an instance of /dev/ppp and connect the channel to it */
34 if (ioctl(fd, PPPIOCGCHAN, &chindex) == -1) {
35 error("Couldn't get channel number: %m");