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
ca10d0a2
Commit
ca10d0a2
authored
Jun 10, 2017
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interfaces: remove renaming of interfaces
parent
a57d0e88
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
23 deletions
+6
-23
interfaces.inc
src/etc/inc/interfaces.inc
+3
-10
interfaces.lib.inc
src/etc/inc/interfaces.lib.inc
+3
-13
No files found.
src/etc/inc/interfaces.inc
View file @
ca10d0a2
...
@@ -1919,16 +1919,11 @@ function interface_wireless_clone($realif, $wlcfg)
...
@@ -1919,16 +1919,11 @@ function interface_wireless_clone($realif, $wlcfg)
}
}
log_error
(
sprintf
(
'Cloning new wireless interface %s'
,
$realif
));
log_error
(
sprintf
(
'Cloning new wireless interface %s'
,
$realif
));
// Create the new wlan interface. FreeBSD returns the new interface name.
exec
(
"/sbin/ifconfig wlan create name
{
$realif
}
wlandev
{
$baseif
}
{
$mode
}
bssid 2>&1"
,
$out
,
$ret
);
// example: wlan2
exec
(
"/sbin/ifconfig wlan create wlandev
{
$baseif
}
{
$mode
}
bssid 2>&1"
,
$out
,
$ret
);
if
(
$ret
<>
0
)
{
if
(
$ret
<>
0
)
{
log_error
(
sprintf
(
'Failed to clone interface %s with error code %s, output %s'
,
$baseif
,
$ret
,
$out
[
0
]));
log_error
(
sprintf
(
'Failed to clone interface %s with error code %s, output %s'
,
$baseif
,
$ret
,
$out
[
0
]));
return
false
;
return
false
;
}
}
$newif
=
trim
(
$out
[
0
]);
// Rename the interface to {$parentnic}_wlan{$number}#: EX: ath0_wlan0
legacy_interface_rename
(
$newif
,
$realif
);
file_put_contents
(
"/tmp/
{
$realif
}
_oldmac"
,
get_interface_mac
(
$realif
));
file_put_contents
(
"/tmp/
{
$realif
}
_oldmac"
,
get_interface_mac
(
$realif
));
}
}
return
true
;
return
true
;
...
@@ -3003,8 +2998,7 @@ function interface_6rd_configure($interface = "wan", $wancfg)
...
@@ -3003,8 +2998,7 @@ function interface_6rd_configure($interface = "wan", $wancfg)
if
(
does_interface_exist
(
$stfiface
))
{
if
(
does_interface_exist
(
$stfiface
))
{
legacy_interface_destroy
(
$stfiface
);
legacy_interface_destroy
(
$stfiface
);
}
}
$tmpstfiface
=
legacy_interface_create
(
'stf'
);
legacy_interface_create
(
'stf'
,
$stfiface
);
legacy_interface_rename
(
$tmpstfiface
,
$stfiface
);
legacy_interface_flags
(
$stfiface
,
'link2'
);
legacy_interface_flags
(
$stfiface
,
'link2'
);
if
(
$wancfg
[
'prefix-6rd-v4plen'
]
>
0
)
{
if
(
$wancfg
[
'prefix-6rd-v4plen'
]
>
0
)
{
$rd6prefixlen
+=
intval
(
$wancfg
[
'prefix-6rd-v4plen'
]);
$rd6prefixlen
+=
intval
(
$wancfg
[
'prefix-6rd-v4plen'
]);
...
@@ -3112,8 +3106,7 @@ function interface_6to4_configure($interface = 'wan', $wancfg)
...
@@ -3112,8 +3106,7 @@ function interface_6to4_configure($interface = 'wan', $wancfg)
if
(
does_interface_exist
(
$stfiface
))
{
if
(
does_interface_exist
(
$stfiface
))
{
legacy_interface_destroy
(
$stfiface
);
legacy_interface_destroy
(
$stfiface
);
}
}
$tmpstfiface
=
legacy_interface_create
(
'stf'
);
legacy_interface_create
(
'stf'
,
$stfiface
);
legacy_interface_rename
(
$tmpstfiface
,
$stfiface
);
legacy_interface_flags
(
$stfiface
,
'link2'
);
legacy_interface_flags
(
$stfiface
,
'link2'
);
mwexec
(
"/sbin/ifconfig
{
$stfiface
}
inet6
{
$stflanpr
}
prefixlen 16"
);
mwexec
(
"/sbin/ifconfig
{
$stfiface
}
inet6
{
$stflanpr
}
prefixlen 16"
);
...
...
src/etc/inc/interfaces.lib.inc
View file @
ca10d0a2
...
@@ -72,11 +72,11 @@ function legacy_interface_flags($ifs, $flag, $report_errors=true)
...
@@ -72,11 +72,11 @@ function legacy_interface_flags($ifs, $flag, $report_errors=true)
}
}
}
}
function
legacy_interface_create
(
$ifs
,
$name
=
null
)
function
legacy_interface_create
(
$ifs
,
$name
=
null
)
{
{
$cmd
=
'/sbin/ifconfig '
.
escapeshellarg
(
$ifs
)
.
' create'
;
$cmd
=
'/sbin/ifconfig '
.
escapeshellarg
(
$ifs
)
.
' create'
;
if
(
!
empty
(
$name
))
{
if
(
!
empty
(
$name
))
{
$cmd
.=
" name "
.
escapeshellarg
(
$name
);
$cmd
.=
' name '
.
escapeshellarg
(
$name
);
}
}
$new
=
null
;
$new
=
null
;
...
@@ -123,16 +123,6 @@ function legacy_interface_deladdress($ifs, $addr)
...
@@ -123,16 +123,6 @@ function legacy_interface_deladdress($ifs, $addr)
}
}
}
}
function
legacy_interface_rename
(
$ifs
,
$name
)
{
$cmd
=
'/sbin/ifconfig '
.
escapeshellarg
(
$ifs
)
.
' name '
.
escapeshellarg
(
$name
);
exec
(
$cmd
.
' 2>&1'
,
$out
,
$ret
);
if
(
$ret
)
{
log_error
(
'The command `'
.
$cmd
.
'\' failed to execute'
);
}
}
function
legacy_interface_mtu
(
$ifs
,
$mtu
)
function
legacy_interface_mtu
(
$ifs
,
$mtu
)
{
{
$cmd
=
'/sbin/ifconfig '
.
escapeshellarg
(
$ifs
)
.
' mtu '
.
escapeshellarg
(
$mtu
);
$cmd
=
'/sbin/ifconfig '
.
escapeshellarg
(
$ifs
)
.
' mtu '
.
escapeshellarg
(
$mtu
);
...
@@ -163,7 +153,7 @@ function legacy_vlan_tag($ifs, $member, $tag, $pcp)
...
@@ -163,7 +153,7 @@ function legacy_vlan_tag($ifs, $member, $tag, $pcp)
}
}
}
}
function
legacy_interface_stats
(
$ifs
=
null
)
function
legacy_interface_stats
(
$ifs
=
null
)
{
{
if
(
$ifs
!=
null
)
{
if
(
$ifs
!=
null
)
{
// only request data for selected interface
// only request data for selected interface
...
...
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