From 9abc79018cab8176643fbad06928b65760501cf7 Mon Sep 17 00:00:00 2001 From: Leona Maroni Date: Wed, 3 Jan 2024 21:16:09 +0100 Subject: [PATCH] nixos/kresd: fix port only regex The output is expected to be a list [ hostname, port, optional ipv6 scope ], but the current regex only outputs [ port ], when only a port is given as address. --- nixos/modules/services/networking/kresd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/kresd.nix b/nixos/modules/services/networking/kresd.nix index 0c7363e564dc..307414abf170 100644 --- a/nixos/modules/services/networking/kresd.nix +++ b/nixos/modules/services/networking/kresd.nix @@ -11,7 +11,7 @@ let mkListen = kind: addr: let al_v4 = builtins.match "([0-9.]+):([0-9]+)($)" addr; al_v6 = builtins.match "\\[(.+)]:([0-9]+)(%.*|$)" addr; - al_portOnly = builtins.match "([0-9]+)" addr; + al_portOnly = builtins.match "(^)([0-9]+)" addr; al = findFirst (a: a != null) (throw "services.kresd.*: incorrect address specification '${addr}'") [ al_v4 al_v6 al_portOnly ];