diff options
author | Ermal Luçi <eri@pfsense.org> | 2010-02-24 12:19:49 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2010-02-24 12:19:49 +0000 |
commit | e1bcba1f598a2d07b2d6ca7830b8091992db10f3 (patch) | |
tree | e50f2115a9799d4d26c6403e42edc4d56396538b /etc/inc/vpn.inc | |
parent | 744187e8b633df9c80b9bcec4834958e754c50e6 (diff) | |
download | pfsense-e1bcba1f598a2d07b2d6ca7830b8091992db10f3.zip pfsense-e1bcba1f598a2d07b2d6ca7830b8091992db10f3.tar.gz |
Prevent errors when running without a lan defined interface. Also remove some dead code.
Diffstat (limited to 'etc/inc/vpn.inc')
-rw-r--r-- | etc/inc/vpn.inc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index ff3c883..f099f93 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -119,7 +119,6 @@ function vpn_ipsec_configure($ipchg = false) $a_phase1 = $config['ipsec']['phase1']; $a_phase2 = $config['ipsec']['phase2']; $a_client = $config['ipsec']['client']; - $lancfg = $config['interfaces']['lan']; $lanip = get_interface_ip("lan"); $lansn = get_interface_subnet("lan"); $lansa = gen_subnet($lanip, $lansn); @@ -743,11 +742,11 @@ EOD; $spdconf = ""; - /* What are these SPD entries for? - * -mgrooms 07/10/2008 - */ - $spdconf .= "spdadd {$lanip}/32 {$lansa}/{$lansn} any -P out none;\n"; - $spdconf .= "spdadd {$lansa}/{$lansn} {$lanip}/32 any -P in none;\n"; + /* Try to prevent people from locking themselves out of webgui. Just in case. */ + if ($config['interfaces']['lan']) { + $spdconf .= "spdadd {$lanip}/32 {$lansa}/{$lansn} any -P out none;\n"; + $spdconf .= "spdadd {$lansa}/{$lansn} {$lanip}/32 any -P in none;\n"; + } foreach ($a_phase2 as $ph2ent) { @@ -783,7 +782,8 @@ EOD; } } mwexec("/sbin/ifconfig gif" . $number_of_gifs . " tunnel" . $curwanip . " " . $rgip); - mwexec("/sbin/ifconfig gif" . $number_of_gifs . " {$lansa}/{$lansn} {$lanip}/32"); + if ($config['interfaces']['lan']) + mwexec("/sbin/ifconfig gif" . $number_of_gifs . " {$lansa}/{$lansn} {$lanip}/32"); } if($ph2ent['mode'] == "tunnel") { |