* [pve-devel] [PATCH container v2] net: do not force network interface down if `link_down` is 0
@ 2025-04-30 12:52 Christoph Heiss
2025-04-30 13:01 ` [pve-devel] applied: " Fabian Grünbichler
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Heiss @ 2025-04-30 12:52 UTC (permalink / raw)
To: pve-devel
Reported in the forum [0].
Currently, the (host) interface is always forced down if the property is
set. Check the actual (boolean) value and honor the users request if set
to `0` aka. off.
[0] https://forum.proxmox.com/threads/bug-container-network-card-turned-off.160691/
Fixes: 9e56948 ("net: Add `link_down` config to allow setting interfaces as disconnected")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
v1: https://lore.proxmox.com/pve-devel/D9JZF1JT3BJ2.2OZG8DKCIRPGS@proxmox.com/T/
Changes v1 -> v2:
* drop redundant defined()ness check (thanks Fabian!)
src/PVE/LXC.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index a58c997..2b9f0cf 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -995,7 +995,7 @@ sub vm_stop_cleanup {
sub net_tap_plug : prototype($$) {
my ($iface, $net) = @_;
- if (defined($net->{link_down})) {
+ if ($net->{link_down}) {
PVE::Tools::run_command(['/sbin/ip', 'link', 'set', 'dev', $iface, 'down']);
# Don't add disconnected interfaces to the bridge, otherwise e.g. applying any network
# change (e.g. `ifreload -a`) could (re-)activate it unintentionally.
--
2.49.0
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH container v2] net: do not force network interface down if `link_down` is 0
2025-04-30 12:52 [pve-devel] [PATCH container v2] net: do not force network interface down if `link_down` is 0 Christoph Heiss
@ 2025-04-30 13:01 ` Fabian Grünbichler
0 siblings, 0 replies; 2+ messages in thread
From: Fabian Grünbichler @ 2025-04-30 13:01 UTC (permalink / raw)
To: pve-devel, Christoph Heiss
On Wed, 30 Apr 2025 14:52:24 +0200, Christoph Heiss wrote:
> Reported in the forum [0].
>
> Currently, the (host) interface is always forced down if the property is
> set. Check the actual (boolean) value and honor the users request if set
> to `0` aka. off.
>
> [0] https://forum.proxmox.com/threads/bug-container-network-card-turned-off.160691/
>
> [...]
Applied, thanks!
[1/1] net: do not force network interface down if `link_down` is 0
commit: bd401aced1e58ea724fadcde73a3a5a8bb6d4abc
Best regards,
--
Fabian Grünbichler <f.gruenbichler@proxmox.com>
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-30 13:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-30 12:52 [pve-devel] [PATCH container v2] net: do not force network interface down if `link_down` is 0 Christoph Heiss
2025-04-30 13:01 ` [pve-devel] applied: " Fabian Grünbichler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal