From: Paul Mackerras Date: Sun, 7 Mar 2010 05:54:00 +0000 (+1100) Subject: rp_pppoe: Copy acName and pppd_pppoe_service after option parsing X-Git-Tag: ppp-2.4.7~52 X-Git-Url: http://git.ozlabs.org/?a=commitdiff_plain;h=cab58617fd9d328029fffabc788020264b4fa91f;p=ppp.git rp_pppoe: Copy acName and pppd_pppoe_service after option parsing 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 --- diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c index e94494b..9bd6643 100644 --- a/pppd/plugins/rp-pppoe/plugin.c +++ b/pppd/plugins/rp-pppoe/plugin.c @@ -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];