diff options
author | Luiz Souza <luiz@netgate.com> | 2017-08-12 00:36:46 -0500 |
---|---|---|
committer | Luiz Souza <luiz@netgate.com> | 2017-08-12 00:36:46 -0500 |
commit | ba969e6771c990f3da296176ee99746262c2fb31 (patch) | |
tree | 9fa5eb0b53741bbee87f28015ea27d6302104b85 /src | |
parent | 363a5c4c72c898b7ec5386c1ce95a69ec523b7b4 (diff) | |
download | pfsense-ba969e6771c990f3da296176ee99746262c2fb31.zip pfsense-ba969e6771c990f3da296176ee99746262c2fb31.tar.gz |
Fix a couple of 'route: writing to routing socket: Invalid argument' warnings during the boot.
Use the correct variable and only add the route when the hostname is resolved (if the remote address is a hostname).
route: writing to routing socket: Invalid argument
Diffstat (limited to 'src')
-rw-r--r-- | src/etc/inc/vpn.inc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/etc/inc/vpn.inc b/src/etc/inc/vpn.inc index 6390aed..8eb2c3c 100644 --- a/src/etc/inc/vpn.inc +++ b/src/etc/inc/vpn.inc @@ -862,7 +862,7 @@ EOD; if (is_ipaddr($right_spec)) { $sourcehost = $right_spec; } else { - $sourcehost = $rgmap['remote-gateway']; + $sourcehost = $rgmap[$right_spec]; } if (substr($ph1ent['interface'], 0, 4) == "_vip") { @@ -888,7 +888,8 @@ EOD; $subnet_bits = get_interface_subnet($vpninterface); $subnet_ip = gen_subnetv4($interfaceip, $subnet_bits); /* if the remote gateway is in the local subnet, then don't add a route */ - if (!ip_in_subnet($sourcehost, "{$subnet_ip}/{$subnet_bits}")) { + if (is_ipaddrv4($sourcehost) && + !ip_in_subnet($sourcehost, "{$subnet_ip}/{$subnet_bits}")) { if (is_ipaddrv4($gatewayip)) { // log_error("IPSEC interface is not WAN but {$ifacesuse}, adding static route for VPN endpoint {$rgip} via {$gatewayip}"); route_add_or_change("-host {$sourcehost} {$gatewayip}"); @@ -902,7 +903,8 @@ EOD; $subnet_bits = get_interface_subnetv6($vpninterface); $subnet_ip = gen_subnetv6($interfaceip, $subnet_bits); /* if the remote gateway is in the local subnet, then don't add a route */ - if (!ip_in_subnet($sourcehost, "{$subnet_ip}/{$subnet_bits}")) { + if (is_ipaddrv6($sourcehost) && + !ip_in_subnet($sourcehost, "{$subnet_ip}/{$subnet_bits}")) { if (is_ipaddrv6($gatewayip)) { // log_error("IPSEC interface is not WAN but {$ifacesuse}, adding static route for VPN endpoint {$rgip} via {$gatewayip}"); route_add_or_change("-inet6 -host {$sourcehost} {$gatewayip}"); |