summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-02-17 13:32:39 -0600
committerJohn Southworth <john.southworth@vyatta.com>2011-02-17 13:32:39 -0600
commite8458e9d818a498bcd1dfda75d8d1802f61404f5 (patch)
tree408ffda1664da57676d0ce439afb67b2c1c7122a /scripts
parent2f61b5bd45fa724d2ed91fcda9a1d9c982f08991 (diff)
downloadvyatta-cfg-vpn-e8458e9d818a498bcd1dfda75d8d1802f61404f5.tar.gz
vyatta-cfg-vpn-e8458e9d818a498bcd1dfda75d8d1802f61404f5.zip
Fix initial boot problems for dhcp interfaces
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vpn-config.pl8
-rwxr-xr-xscripts/vyatta-ipsec-dhcp.pl4
2 files changed, 8 insertions, 4 deletions
diff --git a/scripts/vpn-config.pl b/scripts/vpn-config.pl
index a9b9bf8..a51a4bc 100755
--- a/scripts/vpn-config.pl
+++ b/scripts/vpn-config.pl
@@ -937,7 +937,7 @@ if ( $vcVPN->exists('ipsec') ) {
}
my $index1 = ( defined($authid) ) ? "$authid" : $lip;
my $index2 = ( defined($authremoteid) ) ? "$authremoteid" : $right;
- if ($lip eq '0.0.0.0') {
+ if ($lip eq '0.0.0.0'&&!defined($dhcp_iface)) {
if ($index1 =~ m/^@/) {
# In main mode PSK, the responder needs to look up the secret
# before the Peer's ID payload has been decoded, so the ID used
@@ -953,7 +953,11 @@ if ( $vcVPN->exists('ipsec') ) {
$genout_secrets .= ": PSK \"$psk\"\n";
} else {
if (not ($prev_peer eq $peer)){
- $genout_secrets .= "$lip $right ";
+ if (defined($dhcp_iface) && $lip eq '0.0.0.0'){
+ $genout_secrets .= " $right ";
+ } else {
+ $genout_secrets .= "$lip $right ";
+ }
if ( defined ($authid) ){
$genout_secrets .= "$authid ";
}
diff --git a/scripts/vyatta-ipsec-dhcp.pl b/scripts/vyatta-ipsec-dhcp.pl
index f20a65f..1b7c155 100755
--- a/scripts/vyatta-ipsec-dhcp.pl
+++ b/scripts/vyatta-ipsec-dhcp.pl
@@ -81,9 +81,9 @@ open my $output_secrets, '>', $secrets_file
or die "Can't open $secrets_file";
foreach my $line (@lines){
if (($line =~ /\#dhcp-interface=(.*)\#/) && ($1 eq $iface)){
- $line =~ s/^$oip /$nip /;
+ $line =~ s/^$oip/$nip/;
if (!($line =~ /^oip/)){
- $line =~ s/^/$nip /;
+ $line =~ s/^/$nip/;
}
}
print ${output_secrets} $line;