summaryrefslogtreecommitdiff
path: root/scripts/vyatta-interfaces.pl
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-12-16 12:16:30 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-12-16 12:16:30 -0800
commitbecbaf92760f1f5a9c586acd66ae901fbcf1c855 (patch)
tree7e2aeca2d62f52dacdad4a4284b362d0ff0ae1fd /scripts/vyatta-interfaces.pl
parent945fb88d7ad13e467b9109bdc3919f105595ee74 (diff)
downloadvyatta-cfg-becbaf92760f1f5a9c586acd66ae901fbcf1c855.tar.gz
vyatta-cfg-becbaf92760f1f5a9c586acd66ae901fbcf1c855.zip
Check proper state on DHCP renew/release
Bug 3917 Need to check current state when in operational mode (not config state).
Diffstat (limited to 'scripts/vyatta-interfaces.pl')
-rwxr-xr-xscripts/vyatta-interfaces.pl11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl
index 267ae44..d0bcee8 100755
--- a/scripts/vyatta-interfaces.pl
+++ b/scripts/vyatta-interfaces.pl
@@ -444,6 +444,15 @@ sub is_valid_addr_commit {
exit 0;
}
+# Is interface currently in admin down state?
+sub is_intf_down {
+ my $name = shift;
+ my $intf = new Vyatta::Interface($name);
+
+ return 1 unless $intf;
+ return ! $intf->up();
+}
+
sub op_dhcp_command {
my ($op_command, $intf) = @_;
@@ -451,7 +460,7 @@ sub op_dhcp_command {
unless is_dhcp_enabled($intf);
die "$intf is disabled. Unable to release/renew lease\n"
- if is_intf_disabled($intf);
+ if is_intf_down($intf);
my $tmp_dhclient_dir = '/var/run/vyatta/dhclient/';
my $release_file = $tmp_dhclient_dir . 'dhclient_release_' . $intf;