From 2cd2d134fbf3abca540cc3bc227b9dc04d10534e Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Mon, 29 Apr 2024 09:55:05 +1000 Subject: [PATCH] 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 --- pppd/plugins/pppoe/plugin.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 = { -- 2.39.5