liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 143137cbc663110c837992794066e5f84d682e88
parent 8d228f2bef853c5c8998e8a7fac5302ffb0e8d2b
Author: Daniel Barlow <dan@telent.net>
Date:   Mon,  8 Jul 2024 21:25:42 +0100

pppoe: set lcp echo failure timeout

Diffstat:
Mmodules/ppp/pppoe.nix | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/ppp/pppoe.nix b/modules/ppp/pppoe.nix @@ -9,6 +9,8 @@ { interface, ppp-options }: let inherit (liminix.services) longrun; + lcp-echo-interval = 4; + lcp-echo-failure = 3; name = "${interface.name}.pppoe"; ip-up = writeAshScript "ip-up" {} '' . ${serviceFns} @@ -37,15 +39,19 @@ let "ipparam" name "nodetach" "usepeerdns" + "lcp-echo-interval" (builtins.toString lcp-echo-interval) + "lcp-echo-failure" (builtins.toString lcp-echo-failure) "logfd" "2" ]; in longrun { inherit name; run = '' - . ${serviceFns} - ${ppp}/bin/pppd pty "${pppoe}/bin/pppoe -I $(output ${interface} ifname)" ${lib.concatStringsSep " " ppp-options'} + . ${serviceFns} + 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; + timeout-up = (10 + lcp-echo-failure * lcp-echo-interval) * 1000; dependencies = [ interface ]; }