summaryrefslogtreecommitdiffstats
path: root/lib/network/tools.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-03-05 22:11:38 +0000
committerOlivier Blin <oblin@mandriva.com>2008-03-05 22:11:38 +0000
commit0f999262c29dbc1a7799fb474f5222a074b2ee0c (patch)
tree4c07259978c58472c194fcf00ffe98a9426d6324 /lib/network/tools.pm
parent6ba8e8b249dabf6bd00c814cafeec172532fc992 (diff)
downloaddrakx-net-0f999262c29dbc1a7799fb474f5222a074b2ee0c.tar
drakx-net-0f999262c29dbc1a7799fb474f5222a074b2ee0c.tar.gz
drakx-net-0f999262c29dbc1a7799fb474f5222a074b2ee0c.tar.bz2
drakx-net-0f999262c29dbc1a7799fb474f5222a074b2ee0c.tar.xz
drakx-net-0f999262c29dbc1a7799fb474f5222a074b2ee0c.zip
add is_zeroconf_interface helper
Diffstat (limited to 'lib/network/tools.pm')
-rw-r--r--lib/network/tools.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/network/tools.pm b/lib/network/tools.pm
index 882060e..840834a 100644
--- a/lib/network/tools.pm
+++ b/lib/network/tools.pm
@@ -180,6 +180,11 @@ sub is_real_interface {
!is_virtual_interface($intf) && !is_vlan_interface($intf);
}
+sub is_zeroconf_interface {
+ my ($intf) = @_;
+ is_virtual_interface($intf) && get_interface_ip_address({}, $intf) =~ /^(127|169\.254)\./;
+}
+
sub get_interface_status {
my ($intf) = @_;
$intf = get_real_interface($intf);