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
57bdab56
Commit
57bdab56
authored
Mar 19, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inc: minor tweaks and simplifications
(cherry picked from commit
0822b3dd
)
parent
f03de524
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
22 deletions
+9
-22
interfaces.inc
src/etc/inc/interfaces.inc
+4
-4
interfaces.lib.inc
src/etc/inc/interfaces.lib.inc
+1
-1
util.inc
src/etc/inc/util.inc
+4
-17
No files found.
src/etc/inc/interfaces.inc
View file @
57bdab56
...
...
@@ -3346,8 +3346,8 @@ function interface_6rd_configure($interface = "wan", $wancfg)
return
;
}
if
(
!
is_module_loaded
(
'if_stf
.ko
'
))
{
mwexec
(
'/sbin/kldload if_stf
.ko
'
);
if
(
!
is_module_loaded
(
'if_stf'
))
{
mwexec
(
'/sbin/kldload if_stf'
);
}
$wanif
=
get_real_interface
(
$interface
);
...
...
@@ -3384,7 +3384,7 @@ function interface_6rd_configure($interface = "wan", $wancfg)
/* XXX: need to extend to support variable prefix size for v4 */
if
(
!
is_module_loaded
(
'if_stf'
))
{
mwexec
(
'/sbin/kldload if_stf
.ko
'
);
mwexec
(
'/sbin/kldload if_stf'
);
}
$stfiface
=
"
{
$interface
}
_stf"
;
if
(
does_interface_exist
(
$stfiface
))
{
...
...
@@ -3497,7 +3497,7 @@ function interface_6to4_configure($interface = 'wan', $wancfg)
/* setup the stf interface */
if
(
!
is_module_loaded
(
"if_stf"
))
{
mwexec
(
"/sbin/kldload if_stf
.ko
"
);
mwexec
(
"/sbin/kldload if_stf"
);
}
$stfiface
=
"
{
$interface
}
_stf"
;
if
(
does_interface_exist
(
$stfiface
))
{
...
...
src/etc/inc/interfaces.lib.inc
View file @
57bdab56
...
...
@@ -215,7 +215,7 @@ function legacy_netgraph_attach($ifs)
function
legacy_netgraph_detach
(
$ifs
)
{
mwexecf
(
'/usr/sbin/ngctl msg %s: detach'
,
array
(
$ifs
));
mwexecf
(
'/usr/sbin/ngctl msg %s: detach'
,
array
(
$ifs
)
,
true
);
}
function
legacy_netgraph_rename
(
$tmpifs
,
$ifs
)
...
...
src/etc/inc/util.inc
View file @
57bdab56
...
...
@@ -72,15 +72,7 @@ function is_process_running($process)
function
is_subsystem_dirty
(
$subsystem
=
''
)
{
if
(
$subsystem
==
''
)
{
return
false
;
}
if
(
file_exists
(
"/tmp/
{
$subsystem
}
.dirty"
))
{
return
true
;
}
return
false
;
return
file_exists
(
"/tmp/
{
$subsystem
}
.dirty"
);
}
function
mark_subsystem_dirty
(
$subsystem
=
''
)
...
...
@@ -124,14 +116,9 @@ function unlock($cfglckkey = null)
}
}
function
is_module_loaded
(
$module_name
)
{
$module_name
=
str_replace
(
".ko"
,
""
,
$module_name
);
$running
=
0
;
$_gb
=
exec
(
"/sbin/kldstat -qn
{
$module_name
}
2>&1"
,
$_gb
,
$running
);
if
(
intval
(
$running
)
==
0
)
return
true
;
else
return
false
;
function
is_module_loaded
(
$module_name
)
{
return
!
mwexecf
(
'/sbin/kldstat -qn %s'
,
$module_name
,
true
);
}
/* validate non-negative numeric string, or equivalent numeric variable */
...
...
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