firewall: this is weird, automatic reply-to and route-to...

... should honour if a gateway was actually provided.  It worked
or at least was supposed to work in this way before repairing
get_interface_gateway*().

PR: https://github.com/opnsense/core/issues/3015
This commit is contained in:
Franco Fichtner 2018-12-05 16:38:44 +01:00
parent aed23a9ecb
commit 89bd032069

View File

@ -59,8 +59,16 @@ function filter_core_get_initialized_plugin_system()
foreach ($cnfint as $key => &$value) {
// to set "reply-to" we need to know the gateway for our interface, let's collect it here and pass it on to
// setInterfaceMapping()
$value['gateway'] = get_interface_gateway($key);
$value['gatewayv6'] = get_interface_gateway_v6($key);
if (!empty($value['gateway']) && $value['gateway'] != 'none') {
$value['gateway'] = get_interface_gateway($key);
} else {
$value['gateway'] = null;
}
if (!empty($value['gatewayv6']) && $value['gatewayv6'] != 'none') {
$value['gatewayv6'] = get_interface_gateway_v6($key);
} else {
$value['gatewayv6'] = null;
}
// In some cases we need to know if there currently are addresses configured on an interface, we pass
// the relevant ifconfig data to our interfacemapping (prevents "could not parse host specification" on load)
if (!empty($ifdetails[$value['if']])) {