From f3af01e6e22f8f963f7ac6be9b62ef6daf63c8db Mon Sep 17 00:00:00 2001 From: chn Date: Thu, 11 Dec 2025 14:46:42 +0800 Subject: [PATCH] devices.cross.tinc: fix --- devices/cross/tinc.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/devices/cross/tinc.nix b/devices/cross/tinc.nix index 6ec66c7a..f57792a5 100644 --- a/devices/cross/tinc.nix +++ b/devices/cross/tinc.nix @@ -183,7 +183,13 @@ in { addresses = inputs.lib.optionals (v.address != null) [{ inherit (v) address; }]; settings = { Ed25519PublicKey = publicKey.${v.jump}; IndirectData = true; }; - subnets = [{ address = getAddress "tinc0.${n}"; weight = v.length; }]; + subnets = + [{ + address = getAddress "tinc0.${n}"; + # 最短路径已经被提前计算出来了,这里将权重统一设置为零 + # 如果分开设置,两个节点会因为对权重的描述不统一而拒绝连接 + weight = 0; + }]; };}) (inputs.lib.filterAttrs (_: v: v != null) connection.${hostname}))) ];