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
46c460bb
Commit
46c460bb
authored
Jul 14, 2017
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup, move link_interface_to_vlans to interfaces_assign.php and remove unused code
parent
5525a08a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
26 deletions
+15
-26
interfaces.inc
src/etc/inc/interfaces.inc
+0
-25
interfaces_assign.php
src/www/interfaces_assign.php
+15
-1
No files found.
src/etc/inc/interfaces.inc
View file @
46c460bb
...
...
@@ -4040,31 +4040,6 @@ function link_interface_to_track6($int, $action = '')
}
}
function
link_interface_to_vlans
(
$int
,
$action
=
''
)
{
global
$config
;
if
(
empty
(
$int
))
{
return
;
}
if
(
isset
(
$config
[
'vlans'
][
'vlan'
]))
{
$ifaces
=
array
();
foreach
(
$config
[
'vlans'
][
'vlan'
]
as
$vlan
)
{
if
(
$int
==
$vlan
[
'if'
])
{
if
(
$action
==
"update"
)
{
interfaces_bring_up
(
$int
);
}
elseif
(
$action
==
""
)
{
$ifaces
[
$vlan
[
'tag'
]]
=
$vlan
;
}
}
}
if
(
!
empty
(
$ifaces
))
{
return
$ifaces
;
}
}
}
function
link_interface_to_vips
(
$int
,
$action
=
''
)
{
global
$config
;
...
...
src/www/interfaces_assign.php
View file @
46c460bb
...
...
@@ -35,6 +35,20 @@ require_once("system.inc");
require_once
(
"interfaces.inc"
);
require_once
(
"services.inc"
);
function
link_interface_to_vlans
(
$int
)
{
global
$config
;
if
(
isset
(
$config
[
'vlans'
][
'vlan'
]))
{
foreach
(
$config
[
'vlans'
][
'vlan'
]
as
$vlan
)
{
if
(
$int
==
$vlan
[
'if'
])
{
interfaces_bring_up
(
$int
);
}
}
}
}
function
list_interfaces
()
{
global
$config
;
$interfaces
=
array
();
...
...
@@ -202,7 +216,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if
(
!
empty
(
$config
[
'interfaces'
][
'lan'
])
&&
!
empty
(
$config
[
'dhcpd'
][
'wan'
])
&&
!
empty
(
$config
[
'dhcpd'
][
'wan'
])
)
{
unset
(
$config
[
'dhcpd'
][
'wan'
]);
}
link_interface_to_vlans
(
$realid
,
"update"
);
link_interface_to_vlans
(
$realid
);
header
(
url_safe
(
'Location: /interfaces_assign.php'
));
exit
;
}
...
...
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