diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index f7bbc01457..1fc59e4219 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -2779,11 +2779,13 @@ EOD; /* if tunnel is disabled, lets skip to next item */ $ipsec_ips = array(get_current_wan_address($tunnel['interface'])); /* is this a dynamic dns hostname? */ - $remote_gateway = gethostbyname($tunnel['remote-gateway']); - if($remote_gateway == "") + if(!is_ipaddr($tunnel['remote-gateway'])) { + $remote_gateway = resolve_retry($tunnel['remote-gateway']); + } else { $remote_gateway = $tunnel['remote-gateway']; + } /* do not add items with blank remote_gateway */ - if(!$remote_gateway) { + if(!is_ipaddr($remote_gateway)) { $ipfrules .= "# ERROR! Remote gateway not found on {$tunnel['remote-gateway']}\n"; continue; } @@ -3293,4 +3295,4 @@ function return_vpn_subnet($adr) { } -?> \ No newline at end of file +?>