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 E694E1FF133 for ; Mon, 11 May 2026 17:59:34 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B260C20094; Mon, 11 May 2026 17:59:09 +0200 (CEST) From: Christoph Heiss To: pve-devel@lists.proxmox.com Subject: [PATCH installer v2 5/9] sys: net: drop the now-unused `ipconf` runtime environment configuration Date: Mon, 11 May 2026 17:57:47 +0200 Message-ID: <20260511155753.1623099-6-c.heiss@proxmox.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260511155753.1623099-1-c.heiss@proxmox.com> References: <20260511155753.1623099-1-c.heiss@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778514993760 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.074 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 POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes 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: OXR44LHJYEC3MDQ5BXVRQYPZF6JNX7PZ X-Message-ID-Hash: OXR44LHJYEC3MDQ5BXVRQYPZF6JNX7PZ X-MailFrom: c.heiss@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 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: $run_env->{ipconf} is now completely unused, thus drop the dead code. No functional changes. Signed-off-by: Christoph Heiss --- Changes v1 -> v2: * drop `ipconf` entries from test run-env files Proxmox/Install/RunEnv.pm | 6 -- Proxmox/Sys/Net.pm | 71 +---------------- ...n_from_dhcp_no_default_domain.run-env.json | 76 ------------------- .../no_fqdn_from_dhcp.run-env.json | 76 ------------------- .../tests/resources/run-env-info.json | 76 ------------------- 5 files changed, 2 insertions(+), 303 deletions(-) diff --git a/Proxmox/Install/RunEnv.pm b/Proxmox/Install/RunEnv.pm index b83b9ff..d226ce1 100644 --- a/Proxmox/Install/RunEnv.pm +++ b/Proxmox/Install/RunEnv.pm @@ -136,7 +136,6 @@ my sub detect_country_tracing_to : prototype($$) { # { # arch => , # country => , -# ipconf = , # kernel_cmdline = , # total_memory = , # hvm_supported = <1 if the CPU supports hardware-accelerated virtualization>, @@ -187,11 +186,6 @@ sub query_installation_environment : prototype() { $output->{network}->{hostname} = $fqdn; } - # FIXME: move whatever makes sense over to Proxmox::Sys::Net:: and keep that as single source, - # it can then use some different structure just fine (after adapting the GTK GUI to that) but - # **never** to (slightly different!) things for the same stuff... - $output->{ipconf} = Proxmox::Sys::Net::get_ip_config(); - $output->{kernel_cmdline} = file_read_firstline("/proc/cmdline"); $output->{total_memory} = query_total_memory(); diff --git a/Proxmox/Sys/Net.pm b/Proxmox/Sys/Net.pm index 10144e0..52615ac 100644 --- a/Proxmox/Sys/Net.pm +++ b/Proxmox/Sys/Net.pm @@ -186,78 +186,11 @@ sub get_pin_link_file_content { return sprintf($LINK_FILE_TEMPLATE, $mac, $pin_name); } -sub get_ip_config { - my $ifaces = {}; - my $default; - my $pinned_counter = 0; - - my $links = `ip -o l`; - foreach my $l (split /\n/, $links) { - my ($index, $name, $flags, $state, $mac) = - $l =~ m/^(\d+):\s+(\S+):\s+<(\S+)>.*\s+state\s+(\S+)\s+.*\s+link\/ether\s+(\S+)\s+/; - next if !$name || $name eq 'lo'; - - my $driver = readlink "/sys/class/net/$name/device/driver" || 'unknown'; - $driver =~ s!^.*/!!; - - $ifaces->{"$index"} = { - name => $name, - pinned_id => "${pinned_counter}", - driver => $driver, - flags => $flags, - state => $state, - mac => $mac, - }; - $pinned_counter++; - - my $addresses = `ip -o a s $name`; - for my $addr_line (split /\n/, $addresses) { - my ($family, $ip, $prefix) = - $addr_line =~ m/^\Q$index\E:\s+\Q$name\E\s+(inet|inet6)\s+($IPRE)\/(\d+)\s+/; - next if !$ip; - next if $addr_line =~ /scope\s+link/; # ignore link local - - my $mask = $prefix; - - if ($family eq 'inet') { - next if !$ip =~ /$IPV4RE/; - next if $prefix < 8 || $prefix > 32; - $mask = @$ipv4_reverse_mask[$prefix]; - } else { - next if !$ip =~ /$IPV6RE/; - } - - $default = $index if !$default; - - $ifaces->{"$index"}->{"$family"} = { - prefix => $prefix, - mask => $mask, - addr => $ip, - }; - } - } - - my $route = `ip route`; - my ($gateway) = $route =~ m/^default\s+via\s+(\S+)\s+/m; - - my $resolvconf = `cat /etc/resolv.conf`; - my ($dnsserver) = $resolvconf =~ m/^nameserver\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/m; - my ($domain) = $resolvconf =~ m/^domain\s+(\S+)$/m; - - return { - default => $default, - ifaces => $ifaces, - gateway => $gateway, - dnsserver => $dnsserver, - domain => $domain, - }; -} - sub udevadm_netdev_details { - my $ip_config = get_ip_config(); + my $ifaces = query_netdevs(); my $result = {}; - for my $dev (values $ip_config->{ifaces}->%*) { + for my $dev (values $ifaces->%*) { my $name = $dev->{name}; $result->{$name} = Proxmox::Sys::Udev::get_udev_properties("/sys/class/net/$name"); } diff --git a/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json b/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json index 4c41c13..566e261 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json +++ b/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json @@ -84,82 +84,6 @@ ] ], "hvm_supported": 1, - "ipconf": { - "default": "4", - "dnsserver": "192.168.1.254", - "domain": null, - "gateway": "192.168.1.1", - "ifaces": { - "10": { - "driver": "mlx5_core", - "flags": "NO-CARRIER,BROADCAST,MULTICAST,UP", - "mac": "24:8a:07:1e:05:bd", - "name": "enp193s0f1np1", - "state": "DOWN" - }, - "2": { - "driver": "igb", - "flags": "NO-CARRIER,BROADCAST,MULTICAST,UP", - "mac": "a0:36:9f:0a:b3:82", - "name": "enp65s0f0", - "state": "DOWN" - }, - "3": { - "driver": "igb", - "flags": "NO-CARRIER,BROADCAST,MULTICAST,UP", - "mac": "a0:36:9f:0a:b3:83", - "name": "enp65s0f1", - "state": "DOWN" - }, - "4": { - "driver": "igb", - "flags": "BROADCAST,MULTICAST,UP,LOWER_UP", - "inet": { - "addr": "192.168.1.114", - "mask": "255.255.240.0", - "prefix": 20 - }, - "mac": "b4:2e:99:ac:ad:b4", - "name": "eno1", - "state": "UP" - }, - "5": { - "driver": "cdc_ether", - "flags": "BROADCAST,MULTICAST,UP,LOWER_UP", - "mac": "5a:47:32:dd:c7:47", - "name": "enx5a4732ddc747", - "state": "UNKNOWN" - }, - "6": { - "driver": "igb", - "flags": "BROADCAST,MULTICAST,UP,LOWER_UP", - "mac": "b4:2e:99:ac:ad:b5", - "name": "eno2", - "state": "UP" - }, - "7": { - "driver": "mlx5_core", - "flags": "NO-CARRIER,BROADCAST,MULTICAST,UP", - "mac": "1c:34:da:5c:5e:24", - "name": "enp129s0f0np0", - "state": "DOWN" - }, - "8": { - "driver": "mlx5_core", - "flags": "NO-CARRIER,BROADCAST,MULTICAST,UP", - "mac": "1c:34:da:5c:5e:25", - "name": "enp129s0f1np1", - "state": "DOWN" - }, - "9": { - "driver": "mlx5_core", - "flags": "BROADCAST,MULTICAST,UP,LOWER_UP", - "mac": "24:8a:07:1e:05:bc", - "name": "enp193s0f0np0", - "state": "UP" - } - } - }, "kernel_cmdline": "BOOT_IMAGE=/boot/linux26 ro ramdisk_size=16777216 rw splash=verbose proxdebug vga=788", "network": { "hostname": "pveauto", diff --git a/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json b/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json index fa4e834..909cd7c 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json +++ b/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json @@ -84,82 +84,6 @@ ] ], "hvm_supported": 1, - "ipconf": { - "default": "4", - "dnsserver": "192.168.1.254", - "domain": null, - "gateway": "192.168.1.1", - "ifaces": { - "10": { - "driver": "mlx5_core", - "flags": "NO-CARRIER,BROADCAST,MULTICAST,UP", - "mac": "24:8a:07:1e:05:bd", - "name": "enp193s0f1np1", - "state": "DOWN" - }, - "2": { - "driver": "igb", - "flags": "NO-CARRIER,BROADCAST,MULTICAST,UP", - "mac": "a0:36:9f:0a:b3:82", - "name": "enp65s0f0", - "state": "DOWN" - }, - "3": { - "driver": "igb", - "flags": "NO-CARRIER,BROADCAST,MULTICAST,UP", - "mac": "a0:36:9f:0a:b3:83", - "name": "enp65s0f1", - "state": "DOWN" - }, - "4": { - "driver": "igb", - "flags": "BROADCAST,MULTICAST,UP,LOWER_UP", - "inet": { - "addr": "192.168.1.114", - "mask": "255.255.240.0", - "prefix": 20 - }, - "mac": "b4:2e:99:ac:ad:b4", - "name": "eno1", - "state": "UP" - }, - "5": { - "driver": "cdc_ether", - "flags": "BROADCAST,MULTICAST,UP,LOWER_UP", - "mac": "5a:47:32:dd:c7:47", - "name": "enx5a4732ddc747", - "state": "UNKNOWN" - }, - "6": { - "driver": "igb", - "flags": "BROADCAST,MULTICAST,UP,LOWER_UP", - "mac": "b4:2e:99:ac:ad:b5", - "name": "eno2", - "state": "UP" - }, - "7": { - "driver": "mlx5_core", - "flags": "NO-CARRIER,BROADCAST,MULTICAST,UP", - "mac": "1c:34:da:5c:5e:24", - "name": "enp129s0f0np0", - "state": "DOWN" - }, - "8": { - "driver": "mlx5_core", - "flags": "NO-CARRIER,BROADCAST,MULTICAST,UP", - "mac": "1c:34:da:5c:5e:25", - "name": "enp129s0f1np1", - "state": "DOWN" - }, - "9": { - "driver": "mlx5_core", - "flags": "BROADCAST,MULTICAST,UP,LOWER_UP", - "mac": "24:8a:07:1e:05:bc", - "name": "enp193s0f0np0", - "state": "UP" - } - } - }, "kernel_cmdline": "BOOT_IMAGE=/boot/linux26 ro ramdisk_size=16777216 rw splash=verbose proxdebug vga=788", "network": { "dns": { diff --git a/proxmox-auto-installer/tests/resources/run-env-info.json b/proxmox-auto-installer/tests/resources/run-env-info.json index add5f2a..55c4fe0 100644 --- a/proxmox-auto-installer/tests/resources/run-env-info.json +++ b/proxmox-auto-installer/tests/resources/run-env-info.json @@ -84,82 +84,6 @@ ] ], "hvm_supported": 1, - "ipconf": { - "default": "4", - "dnsserver": "192.168.1.254", - "domain": "test.local", - "gateway": "192.168.1.1", - "ifaces": { - "10": { - "driver": "mlx5_core", - "flags": "NO-CARRIER,BROADCAST,MULTICAST,UP", - "mac": "24:8a:07:1e:05:bd", - "name": "enp193s0f1np1", - "state": "DOWN" - }, - "2": { - "driver": "igb", - "flags": "NO-CARRIER,BROADCAST,MULTICAST,UP", - "mac": "a0:36:9f:0a:b3:82", - "name": "enp65s0f0", - "state": "DOWN" - }, - "3": { - "driver": "igb", - "flags": "NO-CARRIER,BROADCAST,MULTICAST,UP", - "mac": "a0:36:9f:0a:b3:83", - "name": "enp65s0f1", - "state": "DOWN" - }, - "4": { - "driver": "igb", - "flags": "BROADCAST,MULTICAST,UP,LOWER_UP", - "inet": { - "addr": "192.168.1.114", - "mask": "255.255.240.0", - "prefix": 20 - }, - "mac": "b4:2e:99:ac:ad:b4", - "name": "eno1", - "state": "UP" - }, - "5": { - "driver": "cdc_ether", - "flags": "BROADCAST,MULTICAST,UP,LOWER_UP", - "mac": "5a:47:32:dd:c7:47", - "name": "enx5a4732ddc747", - "state": "UNKNOWN" - }, - "6": { - "driver": "igb", - "flags": "BROADCAST,MULTICAST,UP,LOWER_UP", - "mac": "b4:2e:99:ac:ad:b5", - "name": "eno2", - "state": "UP" - }, - "7": { - "driver": "mlx5_core", - "flags": "NO-CARRIER,BROADCAST,MULTICAST,UP", - "mac": "1c:34:da:5c:5e:24", - "name": "enp129s0f0np0", - "state": "DOWN" - }, - "8": { - "driver": "mlx5_core", - "flags": "NO-CARRIER,BROADCAST,MULTICAST,UP", - "mac": "1c:34:da:5c:5e:25", - "name": "enp129s0f1n p1", - "state": "DOWN" - }, - "9": { - "driver": "mlx5_core", - "flags": "BROADCAST,MULTICAST,UP,LOWER_UP", - "mac": "24:8a:07:1e:05:bc", - "name": "enp193s0f0np0", - "state": "UP" - } - } - }, "kernel_cmdline": "BOOT_IMAGE=/boot/linux26 ro ramdisk_size=16777216 rw splash=verbose proxdebug vga=788", "network": { "hostname": "pveauto", -- 2.53.0