]> git.ozlabs.org Git - ppp.git/commitdiff
plugins/pppoe: Use value from pppoe-padi-* options
authorPaul Mackerras <paulus@ozlabs.org>
Sun, 28 Apr 2024 23:55:05 +0000 (09:55 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Thu, 16 May 2024 10:31:37 +0000 (20:31 +1000)
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 <paulus@ozlabs.org>
pppd/plugins/pppoe/plugin.c

index 56a7255e1c24fd470ba1d04f9c973f7b1c6f6bfd..70dcc50adf4445aeba43b836141ed76ab72b3916 100644 (file)
@@ -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 = {