diff -Naur ppp-2.4.5/pppd/sys-linux.c ppp-2.4.5-magellan/pppd/sys-linux.c --- ppp-2.4.5/pppd/sys-linux.c 2009-11-16 23:26:07.000000000 +0100 +++ ppp-2.4.5-magellan/pppd/sys-linux.c 2010-08-20 12:50:10.000000000 +0200 @@ -2031,6 +2031,18 @@ kernel_version = KVERSION(osmaj, osmin, ospatch); fd = open("/dev/ppp", O_RDWR); + if (fd < 0) { + err = errno; + /* try making it and see if that helps. */ + if (err == ENOENT && mknod("/dev/ppp", S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP, + makedev(108, 0)) >= 0) { + fd = open("/dev/ppp", O_RDWR); + if (fd >= 0) + info("Created /dev/ppp device node"); + else + unlink("/dev/ppp"); /* didn't work, undo the mknod */ + } + } if (fd >= 0) { new_style_driver = 1; @@ -2041,16 +2053,15 @@ close(fd); return 1; } - err = errno; if (kernel_version >= KVERSION(2,3,13)) { error("Couldn't open the /dev/ppp device: %m"); - if (errno == ENOENT) + if (err == ENOENT) no_ppp_msg = "You need to create the /dev/ppp device node by\n" "executing the following command as root:\n" " mknod /dev/ppp c 108 0\n"; - else if (errno == ENODEV || errno == ENXIO) + else if (err == ENODEV || err == ENXIO) no_ppp_msg = "Please load the ppp_generic kernel module.\n"; return 0;