Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
48995d12
Commit
48995d12
authored
Nov 04, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) remove cache stuff from find_interface_subnetv6
parent
c10fb545
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
28 deletions
+8
-28
interfaces.inc
src/etc/inc/interfaces.inc
+8
-28
No files found.
src/etc/inc/interfaces.inc
View file @
48995d12
...
...
@@ -2839,7 +2839,6 @@ function interface_vlan_adapt_mtu($vlanifs, $mtu) {
function
interface_configure
(
$interface
=
'wan'
,
$reloadall
=
false
,
$linkupevent
=
false
)
{
global
$config
;
global
$interface_snv6_arr_cache
;
$wancfg
=
$config
[
'interfaces'
][
$interface
];
...
...
@@ -2954,9 +2953,6 @@ function interface_configure($interface = 'wan', $reloadall = false, $linkupeven
legacy_interface_flags
(
$realhwif
,
interface_override_flags
());
}
/* invalidate interface/ip/sn cache */
unset
(
$interface_snv6_arr_cache
[
$realif
]);
$tunnelif
=
substr
(
$realif
,
0
,
3
);
switch
(
$wancfg
[
'ipaddr'
])
{
case
'dhcp'
:
...
...
@@ -3151,7 +3147,6 @@ function interface_track6_configure($interface = 'lan', $wancfg, $linkupevent =
function
interface_track6_6rd_configure
(
$interface
=
'lan'
,
$lancfg
)
{
global
$config
;
global
$interface_snv6_arr_cache
;
if
(
!
is_array
(
$lancfg
))
return
;
...
...
@@ -3201,7 +3196,6 @@ function interface_track6_6rd_configure($interface = 'lan', $lancfg)
$oip
=
find_interface_ipv6
(
$lanif
);
if
(
is_ipaddrv6
(
$oip
))
mwexec
(
"/sbin/ifconfig
{
$lanif
}
inet6
{
$oip
}
delete"
);
unset
(
$interface_snv6_arr_cache
[
$lanif
]);
log_error
(
"rd6
{
$interface
}
with ipv6 address
{
$rd6lan
}
based on
{
$lancfg
[
'track6-interface'
]
}
ipv4
{
$ip4address
}
"
);
mwexec
(
"/sbin/ifconfig
{
$lanif
}
inet6
{
$rd6lan
}
prefixlen 64"
);
...
...
@@ -3211,7 +3205,6 @@ function interface_track6_6rd_configure($interface = 'lan', $lancfg)
function
interface_track6_6to4_configure
(
$interface
=
'lan'
,
$lancfg
)
{
global
$config
;
global
$interface_snv6_arr_cache
;
if
(
!
is_array
(
$lancfg
))
return
;
...
...
@@ -3257,7 +3250,6 @@ function interface_track6_6to4_configure($interface = 'lan', $lancfg)
$oip
=
find_interface_ipv6
(
$lanif
);
if
(
is_ipaddrv6
(
$oip
))
mwexec
(
"/sbin/ifconfig
{
$lanif
}
inet6
{
$oip
}
delete"
);
unset
(
$interface_snv6_arr_cache
[
$lanif
]);
log_error
(
"sixto4
{
$interface
}
with ipv6 address
{
$sixto4lan
}
based on
{
$lancfg
[
'track6-interface'
]
}
ipv4
{
$ip4address
}
"
);
mwexec
(
"/sbin/ifconfig
{
$lanif
}
inet6
{
$sixto4lan
}
prefixlen 64"
);
...
...
@@ -4549,27 +4541,15 @@ function find_interface_subnet($interface) {
return
null
;
}
function
find_interface_subnetv6
(
$interface
,
$flush
=
false
)
{
global
$interface_snv6_arr_cache
;
if
(
!
isset
(
$interface_snv6_arr_cache
)
||
!
is_array
(
$interface_snv6_arr_cache
))
{
$interface_snv6_arr_cache
=
array
();
}
$interface
=
str_replace
(
"
\n
"
,
""
,
$interface
);
if
(
does_interface_exist
(
$interface
)
==
false
)
return
;
if
(
!
isset
(
$interface_snv6_arr_cache
[
$interface
][
'subnetbits6'
])
||
$flush
)
{
function
find_interface_subnetv6
(
$interface
)
{
$interface
=
trim
(
$interface
);
if
(
does_interface_exist
(
$interface
))
{
$ifinfo
=
pfSense_get_interface_addresses
(
$interface
);
if
(
isset
(
$ifinfo
[
'subnetbits6'
]))
{
$interface_snv6_arr_cache
[
$interface
]
=
$ifinfo
[
'subnetbits6'
];
}
else
{
return
null
;
return
$ifinfo
[
'subnetbits6'
];
}
}
return
$interface_snv6_arr_cache
[
$interface
];
return
null
;
}
function
ip_in_interface_alias_subnet
(
$interface
,
$ipalias
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment