diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-12-21 17:32:51 -0800 |
---|---|---|
committer | Stephen Hemminger <shemminger@vyatta.com> | 2011-12-21 17:32:51 -0800 |
commit | 537585b5e1a7d73f7c88b7726d0c1f112329bea3 (patch) | |
tree | a22c1f19f29eeb2c666c59a0bfe45561f4799d76 /scripts | |
parent | 8d2e7843b4e390b63cbced108d93871c34761486 (diff) | |
download | vyatta-cfg-system-537585b5e1a7d73f7c88b7726d0c1f112329bea3.tar.gz vyatta-cfg-system-537585b5e1a7d73f7c88b7726d0c1f112329bea3.zip |
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.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/system/vyatta_interface_rescan | 7 |
1 files changed, 7 insertions, 0 deletions
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); |