Skip to content

Commit

Permalink
plugins/pppoe: Use value from pppoe-padi-* options
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
paulusmack committed May 16, 2024
1 parent 73bd762 commit 2cd2d13
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pppd/plugins/pppoe/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit 2cd2d13

Please sign in to comment.