X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-linux.c;h=587242bb1ed7a2cb0107061a2109e17ccdde1dd1;hb=05bcf644849fd9fb77bf682c996e568ee9ad3a47;hp=28bc4be1a689681e400b14bb4d4226898d75e992;hpb=506e9a3461ec4956215a2477cfde9c7233323173;p=ppp.git diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index 28bc4be..587242b 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -467,6 +467,13 @@ int generic_establish_ppp (int fd) if (new_style_driver) { int flags; + /* If a ppp_fd is already open, close it first */ + if (ppp_fd >= 0) { + close(ppp_fd); + remove_fd(ppp_fd); + ppp_fd = -1; + } + /* Open an instance of /dev/ppp and connect the channel to it */ if (ioctl(fd, PPPIOCGCHAN, &chindex) == -1) { error("Couldn't get channel number: %m");