0008-Try-to-create-dev-ppp-if-not-available.patch 976 B

1234567891011121314151617181920212223242526272829303132333435
  1. From 9b3f313a860f301909dc17332a789ed39aa5a09b Mon Sep 17 00:00:00 2001
  2. From: Mike Frysinger <vapier@gentoo.org>
  3. Date: Fri, 3 Jan 2020 17:18:27 +0100
  4. Subject: [PATCH 08/14] Try to create /dev/ppp if not available
  5. ---
  6. pppd/sys-linux.c | 11 +++++++++++
  7. 1 file changed, 11 insertions(+)
  8. diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
  9. index 95f5a72..33f83ac 100644
  10. --- a/pppd/sys-linux.c
  11. +++ b/pppd/sys-linux.c
  12. @@ -2382,6 +2382,17 @@ int ppp_available(void)
  13. kernel_version = KVERSION(osmaj, osmin, ospatch);
  14. fd = open("/dev/ppp", O_RDWR);
  15. + if (fd < 0) {
  16. + /* try making it and see if that helps. */
  17. + if (errno == ENOENT && mknod("/dev/ppp", S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
  18. + makedev(108, 0)) >= 0) {
  19. + fd = open("/dev/ppp", O_RDWR);
  20. + if (fd >= 0)
  21. + info("Created /dev/ppp device node");
  22. + else
  23. + unlink("/dev/ppp"); /* didn't work, undo the mknod */
  24. + }
  25. + }
  26. if (fd >= 0) {
  27. new_style_driver = 1;
  28. --
  29. 2.30.0