From 537585b5e1a7d73f7c88b7726d0c1f112329bea3 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 21 Dec 2011 17:32:51 -0800 Subject: interfaces: don't add config for missing devices If device disappears or is renamed between the time udev script is run, and the vyatta-router script is run; then don't add an entry to the config file. --- scripts/system/vyatta_interface_rescan | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/system') diff --git a/scripts/system/vyatta_interface_rescan b/scripts/system/vyatta_interface_rescan index 5b72a480..eb45da60 100755 --- a/scripts/system/vyatta_interface_rescan +++ b/scripts/system/vyatta_interface_rescan @@ -115,6 +115,13 @@ sub interface_rescan { foreach my $ifname (sort @interfaces) { my $hwaddr = get_hwid("$VYATTAUDEV/$ifname"); + + # Ignore devices that disappear (or get renamed) + unless (-d "/sys/class/net/$ifname") { + syslog(LOG_INFO, "%s: does not exist", $ifname); + next; + } + unless (persistent_address($hwaddr)) { syslog(LOG_NOTICE, "%s: skipping address %s is not persistent", $ifname, $hwaddr); -- cgit v1.2.3