From 210b41efc0b0d3c27297fa4b1da36937d03ab5dd Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Mon, 31 Mar 2025 23:17:50 +0100 Subject: [PATCH] improve robustness of ppp readiness notification there was a race where ip-up could write ifname and then ip6-up could write its outputs and then test ifname and signal ready before ip-up had written the rest of its outputs --- modules/ppp/common.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/ppp/common.nix b/modules/ppp/common.nix index 352add5..cb48eb5 100644 --- a/modules/ppp/common.nix +++ b/modules/ppp/common.nix @@ -40,15 +40,17 @@ let set +o nounset if test -n "''${DNS1}" ;then echo ''${DNS1} > ns1 ; fi if test -n "''${DNS2}" ;then echo ''${DNS2} > ns2 ; fi - test -e ipv6-address && echo >/proc/self/fd/10 + touch ip-up + test -e ipv6-up && echo >/proc/self/fd/10 ''; ip6-up = writeAshScript "ip6-up" { } '' exec >&5 2>&5 . ${serviceFns} in_outputs ${name} - echo $4 > ipv6-address echo $5 > ipv6-peer-address - test -e ifname && echo >/proc/self/fd/10 + echo $4 > ipv6-address + touch ipv6-up + test -e ip-up && echo >/proc/self/fd/10 ''; literal_or_output = let