From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id E0D3F1FF133 for ; Mon, 11 May 2026 19:02:28 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BC25E21949; Mon, 11 May 2026 19:02:28 +0200 (CEST) Message-ID: <50b1fb9e-bcba-49eb-9332-072363c60f6d@proxmox.com> Date: Mon, 11 May 2026 19:01:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-ve-rs v4 12/31] ve-config: fabrics: wireguard add validation for wireguard config To: Arthur Bied-Charreton References: <20260507124008.417223-1-s.hanreich@proxmox.com> <20260507124008.417223-13-s.hanreich@proxmox.com> Content-Language: en-US From: Stefan Hanreich In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.622 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 2VVAHQ2GZWVH2CJXQULW2N3N2KGQKNYJ X-Message-ID-Hash: 2VVAHQ2GZWVH2CJXQULW2N3N2KGQKNYJ X-MailFrom: s.hanreich@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 5/11/26 3:35 PM, Arthur Bied-Charreton wrote: >> + if let FabricEntry::WireGuard(entry) = self { >> + // check if all interfaces referenced by the peer definitions exist inside the >> + // fabric >> + let mut all_interfaces = HashSet::new(); >> + let mut internal_peers = HashSet::new(); >> + >> + for node_id in entry.nodes.keys() { >> + let node_section = entry.node_section(node_id)?; >> + >> + if let WireGuardNode::Internal(node) = node_section.properties() { >> + all_interfaces.extend( >> + node.interfaces() >> + .map(|interface| (&node_section.id.node_id, &interface.name)), >> + ); >> + >> + internal_peers.extend(node.peers().filter_map(|peer| { >> + if let WireGuardNodePeer::Internal(peer) = peer { >> + return Some((&peer.node, &peer.node_iface)); >> + } >> + >> + None >> + })); >> + } >> + } >> + >> + for (node_id, interface) in internal_peers.difference(&all_interfaces) { >> + return Err(FabricConfigError::InvalidRemoteInterfaceReference( >> + interface.to_string(), >> + node_id.to_string(), >> + )); >> + } > Might make sense to also check for interface IPs that are already set on > other nodes to prevent having 2 nodes with the same IP in a WG fabric. see my reply to the top-level response [snip] >> +impl Validatable for InternalWireGuardNode { >> + type Error = FabricConfigError; >> + >> + /// Validates the [FabricSection]. >> + /// >> + /// Checks if we have either an IPv4 or an IPv6 address. If neither is set, return an error. > Looks like this doc comment is the result of a copy-paste error indeed, have removed it!