mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
interfaces: use Autoconf class to avoid raw ifctl file access
This commit is contained in:
parent
270aac573d
commit
b9b98f12ae
@ -567,7 +567,7 @@ function system_interface_route($gw, $routes)
|
||||
|
||||
if (!$far) {
|
||||
/* special case tries to turn on far gateway when required for dynamic gateway */
|
||||
$dynamicgw = trim(@file_get_contents("/tmp/{$device}_router") ?? '');
|
||||
$dynamicgw = OPNsense\Interface\Autoconf::getRouter($device, 'inet');
|
||||
if (!empty($dynamicgw) && $gateway === $dynamicgw) {
|
||||
list (, $network) = interfaces_primary_address($interface);
|
||||
if (!empty($network) && !ip_in_subnet($gateway, $network)) {
|
||||
|
||||
@ -66,7 +66,7 @@ if (!is_ipaddr($ip)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$gw = trim(@file_get_contents("/tmp/{$device}_router") ?? '');
|
||||
$gw = OPNsense\Interface\Autoconf::getRouter($device, 'inet');
|
||||
|
||||
$cacheip_file = "/tmp/{$device}_oldip";
|
||||
$cacheip = trim(@file_get_contents($cacheip_file));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user