From ba6dc2331c53310ba4e0e8f9cb54717aa7103eb9 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 15 Nov 2010 13:12:01 -0800 Subject: Add hw-id for existing interfaces to config If config has interface (without hw-id), then add it on boot. --- scripts/system/vyatta_interface_rescan | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'scripts/system/vyatta_interface_rescan') diff --git a/scripts/system/vyatta_interface_rescan b/scripts/system/vyatta_interface_rescan index 2803099b..bdc8fd67 100755 --- a/scripts/system/vyatta_interface_rescan +++ b/scripts/system/vyatta_interface_rescan @@ -96,20 +96,16 @@ sub interface_rescan { close $dir; foreach my $ifname (sort @interfaces) { - my $ifpath = interface_type($ifname) . " $ifname"; - if ($xcp->get_node(['interfaces', $ifpath])) { - syslog(LOG_INFO, "%s: is already in config file", $ifname); - next; - } - my $hwaddr = get_hwid("$VYATTAUDEV/$ifname"); unless (persistent_address($hwaddr)) { - syslog(LOG_INFO, "%s: skipping address %s is not persistent", + syslog(LOG_NOTICE, "%s: skipping address %s is not persistent", $ifname, $hwaddr); next; } # Add new entry to config + my $ifpath = interface_type($ifname) . " $ifname"; + syslog(LOG_INFO, "add config for %s hw-id %s", $ifname, $hwaddr); $xcp->create_node(['interfaces',$ifpath,"hw-id $hwaddr"]); } -- cgit v1.2.3