]> git.ozlabs.org Git - ppp.git/commitdiff
Allows another name other than "ppp" be used as the PPP interface name.
authorAdi Masputra <adi.masputra@sun.com>
Fri, 21 Apr 2000 01:27:17 +0000 (01:27 +0000)
committerAdi Masputra <adi.masputra@sun.com>
Fri, 21 Apr 2000 01:27:17 +0000 (01:27 +0000)
If it's not defined, then use the legacy "ppp" without any changes.

pppd/main.c

index 46863829fdb4bb2a2b874e41ba72e1eecc0d1465..5e047d52c501f1d5ba2525fc0623e90e30429c88 100644 (file)
@@ -17,7 +17,7 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#define RCSID  "$Id: main.c,v 1.95 2000/04/15 10:10:24 paulus Exp $"
+#define RCSID  "$Id: main.c,v 1.96 2000/04/21 01:27:17 masputra Exp $"
 
 #include <stdio.h>
 #include <ctype.h>
@@ -226,6 +226,14 @@ struct protent *protocols[] = {
     NULL
 };
 
+/*
+ * If PPP_DRV_NAME is not defined, use the legacy "ppp" as the
+ * device name.
+ */
+#if !defined(PPP_DRV_NAME)
+#define PPP_DRV_NAME   "ppp"
+#endif /* !defined(PPP_DRV_NAME) */
+
 int
 main(argc, argv)
     int argc;
@@ -1015,7 +1023,7 @@ set_ifunit(iskey)
     int iskey;
 {
     info("Using interface ppp%d", ifunit);
-    slprintf(ifname, sizeof(ifname), "ppp%d", ifunit);
+    slprintf(ifname, sizeof(ifname), PPP_DRV_NAME "%d", ifunit);
     script_setenv("IFNAME", ifname, iskey);
     if (iskey) {
        create_pidfile();       /* write pid to file */