patch-pppd_sys-linux_c 580 B

12345678910111213141516
  1. --- ppp-2.4.4.orig/pppd/sys-linux.c 2005-08-27 00:44:35.000000000 +0200
  2. +++ ppp-2.4.4/pppd/sys-linux.c 2009-06-05 19:12:00.000000000 +0200
  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");