Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pppoe: padi-timeout & padi-attempts config options not used #485

Closed
ipaton1 opened this issue Apr 5, 2024 · 4 comments · Fixed by #492
Closed

pppoe: padi-timeout & padi-attempts config options not used #485

ipaton1 opened this issue Apr 5, 2024 · 4 comments · Fixed by #492
Assignees
Labels
Author Author answer is needed

Comments

@ipaton1
Copy link

ipaton1 commented Apr 5, 2024

commit 8e77984 rp-pppoe plugin: Add options to tune discovery timeout and number of attempts added config options padi-timeout & padi-attempts. However what's actually used during the discovery phase are conn->discoveryTimeout & conn->discoveryAttempts

The commit appears to copy the values into the conn structure with a change to PPPOEInitDevice, however this happens before the config file is read meaning that the used values are just the fixed defaults.

What's required is to copy the values in PPPOEConnectDevice as that happens after the config as been parsed. Something like this alongside the other values from the config file

diff --git a/pppd/plugins/pppoe/plugin.c b/pppd/plugins/pppoe/plugin.c
index 7d4709e..4af680e 100644
--- a/pppd/plugins/pppoe/plugin.c
+++ b/pppd/plugins/pppoe/plugin.c
@@ -195,6 +195,9 @@ PPPOEConnectDevice(void)
        memcpy(conn->hostUniq.payload, &pid, sizeof(pid));
     }
 
+    conn->discoveryTimeout=pppoe_padi_timeout;
+    conn->discoveryAttempts=pppoe_padi_attempts;
+
     conn->acName = acName;
     conn->serviceName = pppd_pppoe_service;
     ppp_set_pppdevnam(devnam);

discovered when tracking down the timeout issue in #484 and trying to change the value in the config that looked like it should alter the 5s timeout I was hitting but didn't

@Neustradamus Neustradamus added the Author Author answer is needed label Apr 17, 2024
@Neustradamus
Copy link
Member

@paulusmack, @enaess: What do you think?

@paulusmack
Copy link
Collaborator

I agree there's a problem - PPPOEInitDevice() is called from PPPoEDevnameHook(), which is called when the ethernet device name is seen while parsing the arguments. So if the pppoe-padi-timeout or pppoe-padi-attempts options come before the ethernet device name, they'll take effect, but if they come after, they'll be ignored. Not ideal.

@paulusmack
Copy link
Collaborator

I pushed a proposed fix to the pppoe-options branch in this repository. @ipaton1 please test it and confirm whether it fixes the problem. If it does I'll merge it.

@Neustradamus
Copy link
Member

@ipaton1: @paulusmack has done it here: https://github.com/ppp-project/ppp/tree/pppoe-options
It is good for you? It can be merged?

@paulusmack paulusmack linked a pull request May 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author Author answer is needed
Development

Successfully merging a pull request may close this issue.

3 participants