projects
/
pve-common.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c453400
)
net: don't die in get_active_interfaces() and try both address families
author
Wolfgang Bumiller
<w.bumiller@proxmox.com>
Thu, 10 Mar 2016 14:28:34 +0000
(15:28 +0100)
committer
Dietmar Maurer
<dietmar@proxmox.com>
Tue, 15 Mar 2016 05:45:29 +0000
(06:45 +0100)
src/PVE/Network.pm
patch
|
blob
|
blame
|
history
diff --git
a/src/PVE/Network.pm
b/src/PVE/Network.pm
index 56af2edae3382df2fcfd5a153448225294c8d34d..78529e108cadbd2f29ba30385909d562e6a7be53 100644
(file)
--- a/
src/PVE/Network.pm
+++ b/
src/PVE/Network.pm
@@
-532,8
+532,10
@@
sub get_active_interfaces {
open my $fh, '<', '/proc/net/dev'
or die "failed to open /proc/net/dev: $!\n";
# And filter by IFF_UP flag fetched via a PF_INET6 socket ioctl:
- socket my $sock, PF_INET6, SOCK_DGRAM, &IPPROTO_IP
- or die "failed to open socket\n";
+ my $sock;
+ socket($sock, PF_INET6, SOCK_DGRAM, &IPPROTO_IP)
+ or socket($sock, PF_INET, SOCK_DGRAM, &IPPROTO_IP)
+ or return [];
my $ifaces = [];
while(defined(my $line = <$fh>)) {