From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 9AC391FF09B for ; Wed, 25 Nov 2026 08:28:36 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id AD3D42163C; Wed, 25 Nov 2026 08:28:34 +0100 (CET) Date: Wed, 25 Nov 2026 08:28:29 +0100 From: Arthur Bied-Charreton To: Stefan Hanreich Subject: Re: [PATCH proxmox-firewall 4/7] firewall: guest: handle network devices without a MAC address Message-ID: References: <20261124175718.512428-1-s.hanreich@proxmox.com> <20261124175718.512428-5-s.hanreich@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261124175718.512428-5-s.hanreich@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795591710354 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.540 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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: Q77DV3HEZWZWHQ2YUS3H3XPNOHQETZ45 X-Message-ID-Hash: Q77DV3HEZWZWHQ2YUS3H3XPNOHQETZ45 X-MailFrom: a.bied-charreton@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 Tue, Nov 24, 2026 at 06:57:14PM +0100, Stefan Hanreich wrote: > A guest network device can lack a MAC address, for example after a > manual edit of the config. qemu-server and pve-container then use a > random one, which the firewall cannot know. Such a guest failed the > parsing of its network config, and with it the whole firewall update. > > Leave the device out of the MAC filter, so that the filter drops its > traffic, like it drops the traffic from any other unknown MAC address. > If none of the devices of a guest has a MAC address, there is no set > to match against, so drop all traffic of the guest instead of skipping > the filter. Likewise, leave the link-local address out of the default > IP filter, which then drops traffic from link-local addresses of the > device. > > pve-firewall effectively behaves the same, as it builds the filters > from a random MAC address that does not match the one of the guest. > [snip] > + let mac_address_set: Vec = firewall_devices > + .iter() > + .filter_map(|(index, device)| { > + let Some(mac_address) = device.mac_address() else { > + log::warn!( > + "guest #{vmid}: net{index} has no MAC address, the MAC filter drops \ > + its traffic" > + ); this warning gets logged every 5 seconds for each such device. since rules are compiled for stopped guests as well it can keep going for a while. pve-firewall handles the same case silently. i think a warning is good but maybe we could do it once per device? not a blocker & fine as a follow-up/future refactor though imo. [snip]