]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/Network.pm
cleanup: regex match group reference
[pve-common.git] / src / PVE / Network.pm
index ac2c168c0ef718b4ec3656d2b6d1259ea6579766..56af2edae3382df2fcfd5a153448225294c8d34d 100644 (file)
@@ -539,13 +539,13 @@ sub get_active_interfaces {
     while(defined(my $line = <$fh>)) {
        next if $line !~ /^\s*([^:\s]+):/;
        my $ifname = $1;
-       my $ifreq = pack($STRUCT_IFREQ_SIOCGIFFLAGS, $1, 0);
+       my $ifreq = pack($STRUCT_IFREQ_SIOCGIFFLAGS, $ifname, 0);
        if (!defined(ioctl($sock, SIOCGIFFLAGS, $ifreq))) {
            warn "failed to get interface flags for: $ifname\n";
            next;
        }
        my ($name, $flags) = unpack($STRUCT_IFREQ_SIOCGIFFLAGS, $ifreq);
-       push @$ifaces, $1 if ($flags & IFF_UP);
+       push @$ifaces, $ifname if ($flags & IFF_UP);
     }
     close $fh;
     close $sock;