Commit f261a6b8 authored by David Johnson's avatar David Johnson

Fix makeIfaceMaps to ensure it doesn't die().

To ensure this can be run without a lock, don't die on a failed open of
/sys/class/net/$iface/address.  The only reason we'll fail to open here
is if the device has gone away after the initial dir listing, and that
can happen either if our code doesn't hold a global lock while calling
this function, or if some other OS process removes a device.
parent 0f755e69
......@@ -470,8 +470,13 @@ sub makeIfaceMaps()
next;
}
#
# To ensure this can be run without a lock, don't die on a failed
# open. The only reason we'll fail to open here is if the device
# has gone away after the initial dir listing.
#
open(FD,"/sys/class/net/$iface/address")
or die "could not open /sys/class/net/$iface/address!";
or next;
my $mac = <FD>;
close(FD);
next if (!defined($mac) || $mac eq '');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment