diff options
Diffstat (limited to 'src/etc/inc/ipsec.inc')
-rw-r--r-- | src/etc/inc/ipsec.inc | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/src/etc/inc/ipsec.inc b/src/etc/inc/ipsec.inc index b90c870..f3e8ef2 100644 --- a/src/etc/inc/ipsec.inc +++ b/src/etc/inc/ipsec.inc @@ -275,28 +275,16 @@ function ipsec_ikeid_next() { function ipsec_get_phase1_src(& $ph1ent) { if ($ph1ent['interface']) { - if (!is_ipaddr($ph1ent['interface'])) { - if (strpos($ph1ent['interface'], '_vip')) { - $if = $ph1ent['interface']; - } else { - $if = get_failover_interface($ph1ent['interface']); - } - if ($ph1ent['protocol'] == "inet6") { - $interfaceip = get_interface_ipv6($if); - } else { - $interfaceip = get_interface_ip($if); - } - } else { - $interfaceip = $ph1ent['interface']; - } - } else { + if (substr($ph1ent['interface'], 0, 4) == "_vip") + $if = $ph1ent['interface']; + else + $if = get_failover_interface($ph1ent['interface']); + } else $if = "wan"; - if ($ph1ent['protocol'] == "inet6") { - $interfaceip = get_interface_ipv6($if); - } else { - $interfaceip = get_interface_ip($if); - } - } + if ($ph1ent['protocol'] == "inet6") + $interfaceip = get_interface_ipv6($if); + else + $interfaceip = get_interface_ip($if); return $interfaceip; } |