From: Paul Mackerras Date: Sun, 28 Apr 2024 23:55:05 +0000 (+1000) Subject: plugins/pppoe: Use value from pppoe-padi-* options X-Git-Tag: v2.5.1~29^2~1 X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=2cd2d134fbf3abca540cc3bc227b9dc04d10534e;p=ppp.git plugins/pppoe: Use value from pppoe-padi-* options Reading the values of pppoe_padi_timeout and pppoe_padi_attempts in PPPOEInitDevice() means that they get sampled when the parsing the ethernet device name. If the user provides the pppoe-padi-attempts or pppoe-padi-timeout option after the ethernet device name, the value given is effectively ignored. Instead, read those variables in pppoe_check_options, which is called after all options have been parsed, so that any user-specified values don't get missed. Signed-off-by: Paul Mackerras --- diff --git a/pppd/plugins/pppoe/plugin.c b/pppd/plugins/pppoe/plugin.c index 56a7255..70dcc50 100644 --- a/pppd/plugins/pppoe/plugin.c +++ b/pppd/plugins/pppoe/plugin.c @@ -128,8 +128,6 @@ PPPOEInitDevice(void) conn->ifName = devnam; conn->discoverySocket = -1; conn->sessionSocket = -1; - conn->discoveryTimeout = pppoe_padi_timeout; - conn->discoveryAttempts = pppoe_padi_attempts; return 1; } @@ -471,6 +469,9 @@ void pppoe_check_options(void) ccp_allowoptions[0].bsd_compress = 0; ccp_wantoptions[0].bsd_compress = 0; + + conn->discoveryTimeout = pppoe_padi_timeout; + conn->discoveryAttempts = pppoe_padi_attempts; } struct channel pppoe_channel = {