+sub get_intf_by_address($) {
+ my $address = shift;
+
+ opendir(INTERFACES, "/sys/class/net");
+
+ while (my $intf = readdir(INTERFACES)) {
+ next if ($intf eq "." or $intf eq "..");
+
+ my $intf_address = &get_nic_property($intf, "address");
+
+ # Skip interfaces without addresses
+ next if ($intf_address eq "");
+
+ # Return a match
+ return $intf if ($intf_address eq $address);
+ }
+
+ closedir(INTERFACES);
+
+ return undef;
+}
+