From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id A18D21FF133 for ; Mon, 11 May 2026 10:56:12 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id AF8F4BC6A; Mon, 11 May 2026 10:56:09 +0200 (CEST) Message-ID: <9afb6cab-e0eb-4b61-80b1-b38702f861b5@proxmox.com> Date: Mon, 11 May 2026 10:55:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH installer 4/8] sys: net: drop the now-unused `ipconf` runtime environment configuration To: Christoph Heiss , pve-devel@lists.proxmox.com References: <20260508184546.113293-1-c.heiss@proxmox.com> <20260508184546.113293-5-c.heiss@proxmox.com> From: Hannes Laimer Content-Language: en-US In-Reply-To: <20260508184546.113293-5-c.heiss@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778489619739 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.069 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: PVCSHTC36VAFBQ5RFPQZQDIJKJ4OUZAQ X-Message-ID-Hash: PVCSHTC36VAFBQ5RFPQZQDIJKJ4OUZAQ X-MailFrom: h.laimer@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->{ipconfig}` is still accessed in `extract_data` (Install.pm) we should probably just use `$run_env->{network}->{interfaces}` like we do for pinning On 2026-05-08 20:45, Christoph Heiss wrote: > $run_env->{ipconf} is now completely unused, thus drop the dead code. > > No functional changes. > > Signed-off-by: Christoph Heiss > --- > Proxmox/Install/RunEnv.pm | 6 ---- > Proxmox/Sys/Net.pm | 71 ++------------------------------------- > 2 files changed, 2 insertions(+), 75 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"); > }