summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/vpn-config.pl51
1 files changed, 9 insertions, 42 deletions
diff --git a/scripts/vpn-config.pl b/scripts/vpn-config.pl
index 3e3835d..4ca4238 100755
--- a/scripts/vpn-config.pl
+++ b/scripts/vpn-config.pl
@@ -63,10 +63,6 @@ my $interfaces_use;
my %key_file_list;
my %public_keys;
-# Set $using_klips to 1 if kernel IPsec support is provided by KLIPS.
-# Set it to 0 us using NETKEY.
-my $using_klips = 0;
-
$genout .= "# generated by $0\n\n";
$genout_secrets .= "# generated by $0\n\n";
$interfaces_use .= "# generated by $0\n\n";
@@ -235,48 +231,19 @@ if ($vcVPN->exists('ipsec')) {
}
$interfaces_use .= "\n}";
- # We need to generate an "interfaces=..." entry in the setup section
- # only if the underlying IPsec kernel code we are using is KLIPS.
- # If we are using NETKEY, the "interfaces=..." entry is essentially
- # not used, though we do need to include the line and the keyword
- # "%none" to keep the IPsec setup code from defaulting the entry.
- if ($using_klips) {
- $genout .= "\tinterfaces=\"";
- my $counter = 0;
+ my $counter = 0;
+ $genout .= "\t";
+ if (hasLocalWildcard($vcVPN, 0)) {
+ $genout .= 'interfaces="';
foreach my $interface (@interfaces) {
- if (!(-d "/sys/class/net/$interface")) {
- next;
- }
- if ($counter > 0) {
- $genout .= ' ';
- }
- $genout .= "ipsec$counter=$interface";
+ next if !-d "/sys/class/net/$interface";
+ next if scalar(getIP($interface)) < 1;
+ $genout .= "ipsec$counter=$interface ";
++$counter;
}
- if (hasLocalWildcard($vcVPN, 0)) {
- if ($counter > 0) {
- $genout .= ' ';
- }
- $genout .= '%defaultroute';
- }
- $genout .= "\"\n";
- }
- else {
- my $counter = 0;
- $genout .= "\t";
- if (hasLocalWildcard($vcVPN, 0)) {
- $genout .= 'interfaces="';
- foreach my $interface (@interfaces) {
- next if !-d "/sys/class/net/$interface";
- next if scalar(getIP($interface)) < 1;
- $genout .= "ipsec$counter=$interface ";
- ++$counter;
- }
- $genout .= '%defaultroute"';
- }
- $genout .= "\n";
-
+ $genout .= '%defaultroute"';
}
+ $genout .= "\n";
} else {
$interfaces_use .= "";