summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMohit Mehta <mohit.mehta@vyatta.com>2008-07-25 10:31:20 +0000
committerMohit Mehta <mohit.mehta@vyatta.com>2008-07-25 10:31:20 +0000
commit8328f95b878ca073b2fbc9bc4a5031cbfb1f03b7 (patch)
tree0b569ab36c5ba8603d84f945cb2128d5c9b96c0f /scripts
parentc97f9d4375f4527001762cde625c96b2cc516dc8 (diff)
downloadvyatta-cfg-8328f95b878ca073b2fbc9bc4a5031cbfb1f03b7.tar.gz
vyatta-cfg-8328f95b878ca073b2fbc9bc4a5031cbfb1f03b7.zip
Fix Bug 3524 dhcp client doesn't insert default route on system reboot
- also move temp files for release of dhcp interface to /var/run from /var/lib
Diffstat (limited to 'scripts')
-rw-r--r--scripts/vyatta-interfaces.pl16
1 files changed, 10 insertions, 6 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl
index 676e196..2f59bd3 100644
--- a/scripts/vyatta-interfaces.pl
+++ b/scripts/vyatta-interfaces.pl
@@ -324,7 +324,7 @@ sub delete_eth_addrs {
if ($addr eq "dhcp") {
stop_dhclient($intf);
- system("rm -f /var/lib/dhcp3/dhclient_$intf\_lease; rm -f /var/lib/dhcp3/$intf\; rm -f /var/lib/dhcp3/release_$intf\;");
+ system("rm -f /var/lib/dhcp3/dhclient_$intf\_lease; rm -f /var/lib/dhcp3/$intf\; rm -f /var/run/vyatta/dhclient/dhclient_release_$intf\;");
exit 0;
}
my $version = is_ip_v4_or_v6($addr);
@@ -468,8 +468,9 @@ sub op_dhcp_command {
print "$intf is not using DHCP to get an IP address\n";
exit 1;
}
-
- my $release_file = $dhclient_dir . 'release_' . $intf;
+
+ my $tmp_dhclient_dir = '/var/run/vyatta/dhclient/';
+ my $release_file = $tmp_dhclient_dir . 'dhclient_release_' . $intf;
if ($op_command eq "dhcp-release") {
if (-e $release_file) {
print "IP address for $intf has already been released.\n";
@@ -477,17 +478,20 @@ sub op_dhcp_command {
} else {
print "Releasing DHCP lease on $intf ...\n";
stop_dhclient($intf);
+ if(! -d $tmp_dhclient_dir ){
+ system ("mkdir $tmp_dhclient_dir\;");
+ }
system ("touch $release_file\;");
exit 0;
}
} elsif ($op_command eq "dhcp-renew") {
- print "Renewing DHCP lease on $intf ...\n";
+ print "Renewing DHCP lease on $intf ...\n";
run_dhclient($intf);
system ("rm -f $release_file\;");
exit 0;
}
-
- exit 0;
+
+ exit 0;
}