pppoe: set lcp echo failure timeout

This commit is contained in:
Daniel Barlow 2024-07-08 21:25:42 +01:00
parent 8d228f2bef
commit 143137cbc6
1 changed files with 8 additions and 2 deletions

View File

@ -9,6 +9,8 @@
{ interface, ppp-options }: { interface, ppp-options }:
let let
inherit (liminix.services) longrun; inherit (liminix.services) longrun;
lcp-echo-interval = 4;
lcp-echo-failure = 3;
name = "${interface.name}.pppoe"; name = "${interface.name}.pppoe";
ip-up = writeAshScript "ip-up" {} '' ip-up = writeAshScript "ip-up" {} ''
. ${serviceFns} . ${serviceFns}
@ -37,15 +39,19 @@ let
"ipparam" name "ipparam" name
"nodetach" "nodetach"
"usepeerdns" "usepeerdns"
"lcp-echo-interval" (builtins.toString lcp-echo-interval)
"lcp-echo-failure" (builtins.toString lcp-echo-failure)
"logfd" "2" "logfd" "2"
]; ];
in in
longrun { longrun {
inherit name; inherit name;
run = '' run = ''
. ${serviceFns} . ${serviceFns}
${ppp}/bin/pppd pty "${pppoe}/bin/pppoe -I $(output ${interface} ifname)" ${lib.concatStringsSep " " ppp-options'} echo Starting pppoe, pppd pid is $$
exec ${ppp}/bin/pppd pty "${pppoe}/bin/pppoe -T ${builtins.toString (4 * lcp-echo-interval)} -I $(output ${interface} ifname)" ${lib.concatStringsSep " " ppp-options'}
''; '';
notification-fd = 10; notification-fd = 10;
timeout-up = (10 + lcp-echo-failure * lcp-echo-interval) * 1000;
dependencies = [ interface ]; dependencies = [ interface ];
} }