mirror of
https://github.com/lucaspalomodevelop/opnsense-core.git
synced 2026-03-13 00:07:27 +00:00
inc: whoops, different way of returning subnets #3355
This commit is contained in:
parent
fe99a9b1e0
commit
b395ec087e
@ -537,7 +537,7 @@ function filter_core_rules_system($fw, $defaults)
|
||||
if (!isset($ifcfg['internal_dynamic']) && $ifcfg['if'] != 'lo0') {
|
||||
$intf_has_v4 = false;
|
||||
$intf_has_v6 = false;
|
||||
foreach (interfaces_addresses($ifcfg['if'], true) as $addr) {
|
||||
foreach (array_keys(interfaces_addresses($ifcfg['if'], true)) as $addr) {
|
||||
$intf_has_v4 = $intf_has_v4 || is_subnetv4($addr);
|
||||
$intf_has_v6 = $intf_has_v6 || is_subnetv6($addr);
|
||||
}
|
||||
|
||||
@ -2330,8 +2330,7 @@ function interface_configure($verbose = false, $interface = 'wan', $reload = fal
|
||||
|
||||
if (!file_exists("/var/run/booting") && !(substr($realif, 0, 4) == "ovpn")) {
|
||||
/* remove all IPv4 and IPv6 addresses */
|
||||
$tmpifaces = interfaces_addresses($realif, true);
|
||||
foreach ($tmpifaces as $tmpiface) {
|
||||
foreach (array_keys(interfaces_addresses($realif, true)) as $tmpiface) {
|
||||
if (is_ipaddrv6($tmpiface) || is_subnetv6($tmpiface)) {
|
||||
if (!is_linklocal($tmpiface)) {
|
||||
mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 {$tmpiface} delete");
|
||||
|
||||
@ -64,8 +64,7 @@ function does_vip_exist($vip)
|
||||
return false;
|
||||
}
|
||||
|
||||
$ifacedata = interfaces_addresses($realif, true);
|
||||
foreach ($ifacedata as $vipips) {
|
||||
foreach (array_keys(interfaces_addresses($realif, true)) as $vipips) {
|
||||
if ($vipips == "{$vip['subnet']}/{$vip['subnet_bits']}") {
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user