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
c10fb545
Commit
c10fb545
authored
Nov 04, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) remove cache stuff from find_interface_subnet
parent
8da32378
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
22 deletions
+8
-22
interfaces.inc
src/etc/inc/interfaces.inc
+8
-22
No files found.
src/etc/inc/interfaces.inc
View file @
c10fb545
...
...
@@ -2839,7 +2839,6 @@ function interface_vlan_adapt_mtu($vlanifs, $mtu) {
function
interface_configure
(
$interface
=
'wan'
,
$reloadall
=
false
,
$linkupevent
=
false
)
{
global
$config
;
global
$interface_sn_arr_cache
;
global
$interface_snv6_arr_cache
;
$wancfg
=
$config
[
'interfaces'
][
$interface
];
...
...
@@ -2956,7 +2955,6 @@ function interface_configure($interface = 'wan', $reloadall = false, $linkupeven
}
/* invalidate interface/ip/sn cache */
unset
(
$interface_sn_arr_cache
[
$realif
]);
unset
(
$interface_snv6_arr_cache
[
$realif
]);
$tunnelif
=
substr
(
$realif
,
0
,
3
);
...
...
@@ -4540,27 +4538,15 @@ function find_interface_ipv6_ll($interface) {
return
null
;
}
function
find_interface_subnet
(
$interface
,
$flush
=
false
)
{
global
$interface_sn_arr_cache
;
if
(
!
isset
(
$interface_sn_arr_cache
)
||
!
is_array
(
$interface_sn_arr_cache
)){
$interface_sn_arr_cache
=
array
();
}
$interface
=
str_replace
(
"
\n
"
,
""
,
$interface
);
if
(
does_interface_exist
(
$interface
)
==
false
)
return
;
if
(
!
isset
(
$interface_sn_arr_cache
[
$interface
][
'subnetbits'
])
||
$flush
)
{
$ifinfo
=
pfSense_get_interface_addresses
(
$interface
);
if
(
isset
(
$ifinfo
[
'subnetbits'
]))
{
$interface_sn_arr_cache
[
$interface
]
=
$ifinfo
[
'subnetbits'
];
}
else
{
return
null
;
function
find_interface_subnet
(
$interface
)
{
$interface
=
trim
(
$interface
);
if
(
does_interface_exist
(
$interface
))
{
$ifinfo
=
pfSense_get_interface_addresses
(
$interface
);
if
(
isset
(
$ifinfo
[
'subnetbits'
]))
{
return
$ifinfo
[
'subnetbits'
];
}
}
}
return
$interface_sn_arr_cache
[
$interface
];
return
null
;
}
function
find_interface_subnetv6
(
$interface
,
$flush
=
false
)
{
...
...
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