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
ddc987e2
Commit
ddc987e2
authored
Nov 30, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interfaces: fix a (mildy amusing) crash report
parent
2daf0e20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
interfaces.inc
src/etc/inc/interfaces.inc
+16
-12
No files found.
src/etc/inc/interfaces.inc
View file @
ddc987e2
...
...
@@ -3995,34 +3995,38 @@ function convert_friendly_interface_to_real_interface_name($interface) {
return
get_real_interface
(
$interface
);
}
/*
* convert_real_interface_to_friendly_interface_name($interface): convert fxp0 -> wan, etc.
*/
function
convert_real_interface_to_friendly_interface_name
(
$interface
=
"wan"
)
{
/* convert fxp0 -> wan, etc. */
function
convert_real_interface_to_friendly_interface_name
(
$interface
=
'wan'
)
{
global
$config
;
/* XXX: For speed reasons reference directly the interface array */
$ifdescrs
=
&
$config
[
'interfaces'
];
//$ifdescrs = get_configured_interface_list(false, true);
if
(
!
isset
(
$config
[
'interfaces'
]))
{
/* some people do trigger this, I don't know why :) */
return
NULL
;
}
foreach
(
$
ifdescrs
as
$if
=>
$ifname
)
{
if
(
$if
==
$interface
||
$ifname
[
'if'
]
==
$interface
)
foreach
(
$
config
[
'interfaces'
]
as
$if
=>
$ifname
)
{
if
(
$if
==
$interface
||
$ifname
[
'if'
]
==
$interface
)
{
return
$if
;
}
if
(
get_real_interface
(
$if
)
==
$interface
)
if
(
get_real_interface
(
$if
)
==
$interface
)
{
return
$if
;
}
$int
=
get_parent_interface
(
$if
,
true
);
if
(
is_array
(
$int
))
{
foreach
(
$int
as
$iface
)
{
if
(
$iface
==
$interface
)
if
(
$iface
==
$interface
)
{
return
$if
;
}
}
}
}
if
(
$interface
==
"enc0"
)
if
(
$interface
==
'enc0'
)
{
return
'IPsec'
;
}
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