]> git.ozlabs.org Git - ppp.git/commitdiff
rp_pppoe: Copy acName and pppd_pppoe_service after option parsing
authorPaul Mackerras <paulus@samba.org>
Sun, 7 Mar 2010 05:54:00 +0000 (16:54 +1100)
committerPaul Mackerras <paulus@samba.org>
Sun, 7 Mar 2010 05:54:00 +0000 (16:54 +1100)
At present, the access concentrator name (acName) and service name
(pppd_pppoe_service) are set by option parsing, but are used at the
point of PPPOEInitDevice(), which gets called when the ethernet
device name is seen.  So if the rp_pppoe_service or rp_pppoe_ac
options appear after the device name, they are ignored.

This fixes it by using acName and pppd_pppoe_service in
PPPOEConnectDevice, which gets called after all options have been
parsed.

Signed-off-by: Paul Mackerras <paulus@samba.org>
pppd/plugins/rp-pppoe/plugin.c

index e94494b96cc08587e05def9f7f1ec5023dc8bd9a..9bd66433f3fec933905f6d073814d0292d3936a1 100644 (file)
@@ -108,8 +108,6 @@ PPPOEInitDevice(void)
        novm("PPPoE session data");
     }
     memset(conn, 0, sizeof(PPPoEConnection));
-    conn->acName = acName;
-    conn->serviceName = pppd_pppoe_service;
     conn->ifName = devnam;
     conn->discoverySocket = -1;
     conn->sessionSocket = -1;
@@ -133,6 +131,8 @@ PPPOEConnectDevice(void)
 {
     struct sockaddr_pppox sp;
 
+    conn->acName = acName;
+    conn->serviceName = pppd_pppoe_service;
     strlcpy(ppp_devnam, devnam, sizeof(ppp_devnam));
     if (existingSession) {
        unsigned int mac[ETH_ALEN];