1 pppd: Close already open ppp descriptors
3 When using the kernel PPPoE driver in conjunction with the "persist" option,
4 the already open descriptor to /dev/ppp is not closed when the link is
5 reestablished. This eventually leads to high CPU load because the stray
6 descriptors are always reported as ready by select().
8 This patch closes the descriptor if it is already open when establishing a
9 new connection. It originated from the Debian project.
11 Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
13 --- a/pppd/sys-linux.c
14 +++ b/pppd/sys-linux.c
15 @@ -458,6 +458,13 @@ int generic_establish_ppp (int fd)
16 if (new_style_driver) {
19 + /* if a ppp_fd is already open, close it first */
26 /* Open an instance of /dev/ppp and connect the channel to it */
27 if (ioctl(fd, PPPIOCGCHAN, &chindex) == -1) {
28 error("Couldn't get channel number: %m");