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
bc6bbc40
Commit
bc6bbc40
authored
Nov 04, 2015
by
Ad Schellevis
Committed by
Franco Fichtner
Nov 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) remove cache stuff from find_interface_ip
(cherry picked from commit
c73d86fe
)
parent
4c48ab5d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
28 deletions
+12
-28
gwlb.inc
src/etc/inc/gwlb.inc
+1
-1
interfaces.inc
src/etc/inc/interfaces.inc
+10
-24
rc.newwanip
src/etc/rc.newwanip
+1
-1
carp_status.php
src/www/carp_status.php
+0
-2
No files found.
src/etc/inc/gwlb.inc
View file @
bc6bbc40
...
@@ -168,7 +168,7 @@ EOD;
...
@@ -168,7 +168,7 @@ EOD;
* the if block. So using $gateway['ipprotocol'] is the better option.
* the if block. So using $gateway['ipprotocol'] is the better option.
*/
*/
if
(
$gateway
[
'ipprotocol'
]
==
"inet"
)
{
// This is an IPv4 gateway...
if
(
$gateway
[
'ipprotocol'
]
==
"inet"
)
{
// This is an IPv4 gateway...
$gwifip
=
find_interface_ip
(
$gateway
[
'interface'
]
,
true
);
$gwifip
=
find_interface_ip
(
$gateway
[
'interface'
]);
if
(
!
is_ipaddrv4
(
$gwifip
))
if
(
!
is_ipaddrv4
(
$gwifip
))
continue
;
//Skip this target
continue
;
//Skip this target
...
...
src/etc/inc/interfaces.inc
View file @
bc6bbc40
...
@@ -2839,7 +2839,7 @@ function interface_vlan_adapt_mtu($vlanifs, $mtu) {
...
@@ -2839,7 +2839,7 @@ function interface_vlan_adapt_mtu($vlanifs, $mtu) {
function
interface_configure
(
$interface
=
'wan'
,
$reloadall
=
false
,
$linkupevent
=
false
)
function
interface_configure
(
$interface
=
'wan'
,
$reloadall
=
false
,
$linkupevent
=
false
)
{
{
global
$config
;
global
$config
;
global
$interface_sn_arr_cache
,
$interface_ip_arr_cache
;
global
$interface_sn_arr_cache
;
global
$interface_snv6_arr_cache
,
$interface_ipv6_arr_cache
;
global
$interface_snv6_arr_cache
,
$interface_ipv6_arr_cache
;
$wancfg
=
$config
[
'interfaces'
][
$interface
];
$wancfg
=
$config
[
'interfaces'
][
$interface
];
...
@@ -2956,7 +2956,6 @@ function interface_configure($interface = 'wan', $reloadall = false, $linkupeven
...
@@ -2956,7 +2956,6 @@ function interface_configure($interface = 'wan', $reloadall = false, $linkupeven
}
}
/* invalidate interface/ip/sn cache */
/* invalidate interface/ip/sn cache */
unset
(
$interface_ip_arr_cache
[
$realif
]);
unset
(
$interface_sn_arr_cache
[
$realif
]);
unset
(
$interface_sn_arr_cache
[
$realif
]);
unset
(
$interface_ipv6_arr_cache
[
$realif
]);
unset
(
$interface_ipv6_arr_cache
[
$realif
]);
unset
(
$interface_snv6_arr_cache
[
$realif
]);
unset
(
$interface_snv6_arr_cache
[
$realif
]);
...
@@ -4505,29 +4504,16 @@ function link_interface_to_gif($interface)
...
@@ -4505,29 +4504,16 @@ function link_interface_to_gif($interface)
/*
/*
* find_interface_ip($interface): return the interface ip (first found)
* find_interface_ip($interface): return the interface ip (first found)
*/
*/
function
find_interface_ip
(
$interface
,
$flush
=
false
)
{
function
find_interface_ip
(
$interface
)
{
global
$interface_ip_arr_cache
;
$interface
=
trim
(
$interface
);
if
(
does_interface_exist
(
$interface
))
{
if
(
!
isset
(
$interface_ip_arr_cache
)
||
!
is_array
(
$interface_ip_arr_cache
))
{
$ifinfo
=
pfSense_get_interface_addresses
(
$interface
);
$interface_ip_arr_cache
=
array
()
;
if
(
isset
(
$ifinfo
[
'ipaddr'
]))
{
}
return
$ifinfo
[
'ipaddr'
];
}
$interface
=
str_replace
(
"
\n
"
,
""
,
$interface
);
}
else
{
return
null
;
if
(
!
does_interface_exist
(
$interface
))
return
;
/* Setup IP cache */
if
(
!
isset
(
$interface_ip_arr_cache
[
$interface
])
or
$flush
)
{
$ifinfo
=
pfSense_get_interface_addresses
(
$interface
);
if
(
isset
(
$ifinfo
[
'ipaddr'
]))
{
$interface_ip_arr_cache
[
$interface
]
=
$ifinfo
[
'ipaddr'
];
}
else
{
return
null
;
}
}
}
return
$interface_ip_arr_cache
[
$interface
];
}
}
/*
/*
...
...
src/etc/rc.newwanip
View file @
bc6bbc40
...
@@ -76,7 +76,7 @@ if (is_array($config['interfaces'][$interface]) && !isset($config['interfaces'][
...
@@ -76,7 +76,7 @@ if (is_array($config['interfaces'][$interface]) && !isset($config['interfaces'][
if
(
empty
(
$argument
))
{
if
(
empty
(
$argument
))
{
$curwanip
=
get_interface_ip
();
$curwanip
=
get_interface_ip
();
}
else
{
}
else
{
$curwanip
=
find_interface_ip
(
$interface_real
,
true
);
$curwanip
=
find_interface_ip
(
$interface_real
);
if
(
empty
(
$curwanip
))
{
if
(
empty
(
$curwanip
))
{
$curwanip
=
get_interface_ip
(
$interface
);
$curwanip
=
get_interface_ip
(
$interface
);
}
}
...
...
src/www/carp_status.php
View file @
bc6bbc40
...
@@ -51,9 +51,7 @@ function interfaces_carp_set_maintenancemode($carp_maintenancemode)
...
@@ -51,9 +51,7 @@ function interfaces_carp_set_maintenancemode($carp_maintenancemode)
}
}
unset
(
$interface_arr_cache
);
unset
(
$carp_interface_count_cache
);
unset
(
$carp_interface_count_cache
);
unset
(
$interface_ip_arr_cache
);
$status
=
get_carp_status
();
$status
=
get_carp_status
();
if
(
$_POST
[
'carp_maintenancemode'
]
<>
""
)
{
if
(
$_POST
[
'carp_maintenancemode'
]
<>
""
)
{
...
...
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