]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/rp-pppoe/plugin.c
Service-name was not being set correctly in PPPoE plugin.
[ppp.git] / pppd / plugins / rp-pppoe / plugin.c
index ceef0512eb8d80893a1b1bf4f424fd7c7668daa0..e97d06a8a5aeb9c906426fb26313ac37f8e90952 100644 (file)
@@ -22,7 +22,7 @@
 ***********************************************************************/
 
 static char const RCSID[] =
-"$Id: plugin.c,v 1.2 2002/01/22 16:03:05 dfs Exp $";
+"$Id: plugin.c,v 1.4 2002/02/27 16:00:30 dfs Exp $";
 
 #define _GNU_SOURCE 1
 #include "pppoe.h"
@@ -59,9 +59,10 @@ char pppd_version[] = VERSION;
 /* From sys-linux.c in pppd -- MUST FIX THIS! */
 extern int new_style_driver;
 
-static char *service = NULL;
+char *pppd_pppoe_service = NULL;
 static char *acName = NULL;
 static char *existingSession = NULL;
+static int printACNames = 0;
 
 static int PPPoEDevnameHook(const char *name);
 static option_t Options[] = {
@@ -69,12 +70,14 @@ static option_t Options[] = {
       "PPPoE device name",
       OPT_DEVNAM | OPT_PRIVFIX | OPT_NOARG  | OPT_A2STRVAL | OPT_STATIC,
       devnam},
-    { "rp_pppoe_service", o_string, &service,
+    { "rp_pppoe_service", o_string, &pppd_pppoe_service,
       "Desired PPPoE service name" },
     { "rp_pppoe_ac",      o_string, &acName,
       "Desired PPPoE access concentrator name" },
     { "rp_pppoe_sess",    o_string, &existingSession,
       "Attach to existing session (sessid:macaddr)" },
+    { "rp_pppoe_verbose", o_int, &printACNames,
+      "Be verbose about discovered access concentrators"},
     { NULL }
 };
 int (*OldDevnameHook)(const char *name) = NULL;
@@ -100,13 +103,14 @@ PPPOEInitDevice(void)
     if (acName) {
        SET_STRING(conn->acName, acName);
     }
-    if (service) {
-       SET_STRING(conn->serviceName, acName);
+    if (pppd_pppoe_service) {
+       SET_STRING(conn->serviceName, pppd_pppoe_service);
     }
     SET_STRING(conn->ifName, devnam);
     conn->discoverySocket = -1;
     conn->sessionSocket = -1;
     conn->useHostUniq = 1;
+    conn->printACNames = printACNames;
     return 1;
 }