101-debian_close_dev_ppp.patch 487 B

12345678910111213141516
  1. --- a/pppd/sys-linux.c
  2. +++ b/pppd/sys-linux.c
  3. @@ -453,6 +453,13 @@ int generic_establish_ppp (int fd)
  4. if (new_style_driver) {
  5. int flags;
  6. + /* if a ppp_fd is already open, close it first */
  7. + if(ppp_fd > 0) {
  8. + close(ppp_fd);
  9. + remove_fd(ppp_fd);
  10. + ppp_fd = -1;
  11. + }
  12. +
  13. /* Open an instance of /dev/ppp and connect the channel to it */
  14. if (ioctl(fd, PPPIOCGCHAN, &chindex) == -1) {
  15. error("Couldn't get channel number: %m");