Skip to content

Commit

Permalink
Routing, gateways for #2279 align automatic gateways to legacy behavi…
Browse files Browse the repository at this point in the history
…our. Since gif/gre interfaces already write _router files, we should only add openvpn client gateways to mimic the way it wasbefore. Also skip disabled interfaces.
  • Loading branch information
AdSchellevis committed Apr 17, 2019
1 parent f6c0e84 commit 4dd8df5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/opnsense/mvc/app/library/OPNsense/Routing/Gateways.php
Expand Up @@ -187,6 +187,10 @@ public function getGateways()
}
// add dynamic gateways
foreach ($definedIntf as $ifname => $ifcfg) {
if (empty($ifcfg['enable'])) {
// only consider active interfaces
continue;
}
foreach (["inet", "inet6"] as $ipproto) {
// filename suffix and interface type as defined in the interface
$descr = !empty($ifcfg['descr']) ? $ifcfg['descr'] : $ifname;
Expand Down Expand Up @@ -223,7 +227,7 @@ public function getGateways()
}
$gwkey = $this->newKey($thisconf['priority'], !empty($thisconf['defaultgw']));
$this->cached_gateways[$gwkey] = $thisconf;
} elseif (self::convertType($ipproto, $ifcfg) != null) {
} elseif (substr($ifcfg['if'], 0, 5) == "ovpnc") {
// other predefined types, only bound by interface (e.g. openvpn)
$gwkey = $this->newKey($thisconf['priority'], !empty($thisconf['defaultgw']));
// gateway should only contain a valid address, make sure its empty
Expand Down

0 comments on commit 4dd8df5

Please sign in to comment.