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
47aaef9d
Commit
47aaef9d
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_ipv6
(cherry picked from commit
154b9a29
)
parent
bc6bbc40
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
35 deletions
+14
-35
gwlb.inc
src/etc/inc/gwlb.inc
+3
-3
interfaces.inc
src/etc/inc/interfaces.inc
+11
-32
No files found.
src/etc/inc/gwlb.inc
View file @
47aaef9d
...
...
@@ -190,7 +190,7 @@ EOD;
if
(
is_linklocal
(
$gateway
[
'gateway'
]))
{
$gwifip
=
find_interface_ipv6_ll
(
$gateway
[
'interface'
],
true
);
}
else
{
$gwifip
=
find_interface_ipv6
(
$gateway
[
'interface'
]
,
true
);
$gwifip
=
find_interface_ipv6
(
$gateway
[
'interface'
]);
}
}
else
{
/* 'monitor' has been set, so makes sure it has precedence over
...
...
@@ -198,14 +198,14 @@ EOD;
* is a local link and 'monitor' is global routable then the
* ICMP6 response would not find its way back home...
*/
$gwifip
=
find_interface_ipv6
(
$gateway
[
'interface'
]
,
true
);
$gwifip
=
find_interface_ipv6
(
$gateway
[
'interface'
]);
if
(
is_linklocal
(
$gateway
[
'monitor'
]))
{
if
(
!
strstr
(
$gateway
[
'monitor'
],
'%'
))
{
$gateway
[
'monitor'
]
.=
"%
{
$gateway
[
'interface'
]
}
"
;
}
}
else
{
// Monitor is a routable address, so use a routable address for the "src" part
$gwifip
=
find_interface_ipv6
(
$gateway
[
'interface'
]
,
true
);
$gwifip
=
find_interface_ipv6
(
$gateway
[
'interface'
]);
}
}
...
...
src/etc/inc/interfaces.inc
View file @
47aaef9d
...
...
@@ -2840,7 +2840,7 @@ function interface_configure($interface = 'wan', $reloadall = false, $linkupeven
{
global
$config
;
global
$interface_sn_arr_cache
;
global
$interface_snv6_arr_cache
,
$interface_ipv6_arr_cache
;
global
$interface_snv6_arr_cache
;
$wancfg
=
$config
[
'interfaces'
][
$interface
];
...
...
@@ -2957,7 +2957,6 @@ function interface_configure($interface = 'wan', $reloadall = false, $linkupeven
/* invalidate interface/ip/sn cache */
unset
(
$interface_sn_arr_cache
[
$realif
]);
unset
(
$interface_ipv6_arr_cache
[
$realif
]);
unset
(
$interface_snv6_arr_cache
[
$realif
]);
$tunnelif
=
substr
(
$realif
,
0
,
3
);
...
...
@@ -3158,7 +3157,6 @@ function interface_track6_configure($interface = 'lan', $wancfg, $linkupevent =
function
interface_track6_6rd_configure
(
$interface
=
'lan'
,
$lancfg
)
{
global
$config
;
global
$interface_ipv6_arr_cache
;
global
$interface_snv6_arr_cache
;
if
(
!
is_array
(
$lancfg
))
...
...
@@ -3209,7 +3207,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_ipv6_arr_cache
[
$lanif
]);
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"
);
...
...
@@ -3220,7 +3217,6 @@ function interface_track6_6rd_configure($interface = 'lan', $lancfg)
function
interface_track6_6to4_configure
(
$interface
=
'lan'
,
$lancfg
)
{
global
$config
;
global
$interface_ipv6_arr_cache
;
global
$interface_snv6_arr_cache
;
if
(
!
is_array
(
$lancfg
))
...
...
@@ -3267,7 +3263,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_ipv6_arr_cache
[
$lanif
]);
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"
);
...
...
@@ -4511,39 +4506,23 @@ function find_interface_ip($interface) {
if
(
isset
(
$ifinfo
[
'ipaddr'
]))
{
return
$ifinfo
[
'ipaddr'
];
}
}
else
{
return
null
;
}
return
null
;
}
/*
* find_interface_ipv6($interface): return the interface ip (first found)
*/
function
find_interface_ipv6
(
$interface
,
$flush
=
false
)
{
global
$interface_ipv6_arr_cache
;
global
$config
;
if
(
!
isset
(
$interface_ipv6_arr_cache
)
||
!
is_array
(
$interface_ipv6_arr_cache
))
{
$interface_ipv6_arr_cache
=
array
();
}
$interface
=
trim
(
$interface
);
$interface
=
get_real_interface
(
$interface
);
if
(
!
does_interface_exist
(
$interface
))
return
;
/* Setup IP cache */
if
(
!
isset
(
$interface_ipv6_arr_cache
[
$interface
])
or
$flush
)
{
$ifinfo
=
pfSense_get_interface_addresses
(
$interface
);
if
(
isset
(
$ifinfo
[
'ipaddr6'
]))
{
$interface_ipv6_arr_cache
[
$interface
]
=
$ifinfo
[
'ipaddr6'
];
}
else
{
return
null
;
function
find_interface_ipv6
(
$interface
)
{
// a bit obscure, why should this be different then find_interface_ip?
$interface
=
get_real_interface
(
trim
(
$interface
));
if
(
does_interface_exist
(
$interface
))
{
$ifinfo
=
pfSense_get_interface_addresses
(
$interface
);
if
(
isset
(
$ifinfo
[
'ipaddr6'
]))
{
return
$ifinfo
[
'ipaddr6'
];
}
}
}
return
$interface_ipv6_arr_cache
[
$interface
];
return
null
;
}
/*
...
...
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