-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
luci-proto-3g/ppp/pppossh: fix being unable to set keepalive to 0 #7392
Conversation
protocols/luci-proto-3g/htdocs/luci-static/resources/protocol/3g.js
Outdated
Show resolved
Hide resolved
Since on openwrt keepalive option defaults to "5 1" when it's not defined (https://github.com/openwrt/openwrt/blob/6720c4ccba256186bf2f1b1edadb851c447e62a5/package/network/services/ppp/files/ppp.sh#L128). Users must be able to set it to 0 to ignore connection failures. Signed-off-by: Erdem Gez <[email protected]>
7fbe676
to
765d247
Compare
if (f == null || f == '' || isNaN(f)) | ||
f = 0; | ||
if (f === '' || isNaN(f)) | ||
f = null; | ||
|
||
if (i == null || i == '' || isNaN(i) || i < 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't interval be zero also? I don't know for sure. I get the impression that setting it to zero should turn it off. Does that happen in the init scripts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as failure is less than zero it should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as failure is less than zero it should work.
This just means that setting it to zero disables it (in the init scipt) - which is inaccessible with thei < 1
behaviour. I'm not nit-picking your code- just what's going on here in general. That whole logic could do with a rewrite. Are you game?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can't be less than 1 on luci since there's a check for that
o.datatype = 'min(1)'; |
But if we want users to be able to disable keepalive through the interface by either setting the failure or/and the interval to 0 then yes we'd need to edit the init script too.
I think the init script should be edited regardless to always set the keepalive instead of omitting it when it's 0 since that way pppd may use whatever it's set to on options file.
https://github.com/openwrt/openwrt/blob/6720c4ccba256186bf2f1b1edadb851c447e62a5/package/network/services/ppp/files/etc/ppp/options
@feckert do you also use some flavour of PPP? |
Closed by f3d26a2 |
Since on openwrt keepalive option defaults to "5 1" when it's not defined
(see https://github.com/openwrt/openwrt/blob/6720c4ccba256186bf2f1b1edadb851c447e62a5/package/network/services/ppp/files/ppp.sh#L128).
Users must be able to set it to 0 to ignore connection failures.
Signed-off-by: <[email protected]>
row (viagit commit --signoff
)<package name>: title
first line subject for packages