summaryrefslogtreecommitdiffstats
path: root/src/etc/inc
diff options
context:
space:
mode:
authorLuiz Souza <luiz@netgate.com>2017-08-12 00:36:46 -0500
committerLuiz Souza <luiz@netgate.com>2017-08-12 00:36:46 -0500
commitba969e6771c990f3da296176ee99746262c2fb31 (patch)
tree9fa5eb0b53741bbee87f28015ea27d6302104b85 /src/etc/inc
parent363a5c4c72c898b7ec5386c1ce95a69ec523b7b4 (diff)
downloadpfsense-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/etc/inc')
-rw-r--r--src/etc/inc/vpn.inc8
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}");
OpenPOWER on IntegriCloud