add exit-client-on-disconnect patch

When a startup account exhausts retries (including after an established
connection drops with NumRetry 0), exit the process so systemd can
restart it for a clean reconnect + DHCP.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Git Sagar 2026-06-04 16:41:34 +05:30
parent 9296b3572e
commit d0260c0d8c
2 changed files with 17 additions and 1 deletions

View file

@ -23,7 +23,7 @@ stdenv.mkDerivation (finalAttrs: {
fetchSubmodules = true; fetchSubmodules = true;
}; };
patches = [ ./patches/ipb-profile-key.patch ./patches/tap-name-no-prefix.patch ./patches/prevent-dmesg-call.patch ./patches/simplify_l2tp_auth.patch ]; patches = [ ./patches/ipb-profile-key.patch ./patches/tap-name-no-prefix.patch ./patches/prevent-dmesg-call.patch ./patches/simplify_l2tp_auth.patch ./patches/exit-client-on-disconnect.patch ];
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
cmake cmake

View file

@ -0,0 +1,16 @@
--- a/src/Cedar/Session.c 2026-06-04 16:38:36.571857886 +0530
+++ b/src/Cedar/Session.c 2026-06-04 16:38:36.581858026 +0530
@@ -1789,6 +1789,13 @@
Debug("Session Halt.\n");
+
+ // Exit process when a startup account exhausts retries.
+ // Lets systemd restart the service for a clean reconnect + DHCP.
+ if (s->Account != NULL && s->Account->StartupAccount)
+ {
+ _exit(1);
+ }
s->ClientStatus = CLIENT_STATUS_IDLE;
// Regard as that the session is ended here