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