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
1a7e961d
Commit
1a7e961d
authored
Feb 24, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interfaces: replace netgraph functions with portable alternatives
(cherry picked from commit
5adfd6bf
)
parent
99ee12a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
interfaces.inc
src/etc/inc/interfaces.inc
+5
-5
vpn.inc
src/etc/inc/plugins.inc.d/vpn.inc
+3
-3
No files found.
src/etc/inc/interfaces.inc
View file @
1a7e961d
...
@@ -202,7 +202,7 @@ function interface_netgraph_needed($interface = "wan")
...
@@ -202,7 +202,7 @@ function interface_netgraph_needed($interface = "wan")
if
(
!
$found
)
{
if
(
!
$found
)
{
$realif
=
get_real_interface
(
$interface
);
$realif
=
get_real_interface
(
$interface
);
mwexecf
(
'/usr/sbin/ngctl msg %s: detach'
,
array
(
$realif
)
);
legacy_netgraph_detach
(
$realif
);
}
}
}
}
...
@@ -299,7 +299,7 @@ function interface_vlan_configure(&$vlan)
...
@@ -299,7 +299,7 @@ function interface_vlan_configure(&$vlan)
}
else
{
}
else
{
$tmpvlanif
=
legacy_interface_create
(
'vlan'
);
$tmpvlanif
=
legacy_interface_create
(
'vlan'
);
legacy_interface_rename
(
$tmpvlanif
,
$vlanif
);
legacy_interface_rename
(
$tmpvlanif
,
$vlanif
);
mwexecf
(
'/usr/sbin/ngctl name %s: %s'
,
array
(
$tmpvlanif
,
$vlanif
)
);
legacy_netgraph_rename
(
$tmpvlanif
,
$vlanif
);
}
}
legacy_vlan_tag
(
$vlanif
,
$if
,
$tag
);
legacy_vlan_tag
(
$vlanif
,
$if
,
$tag
);
...
@@ -344,8 +344,8 @@ function interface_qinq_configure(&$vlan, $fd = null)
...
@@ -344,8 +344,8 @@ function interface_qinq_configure(&$vlan, $fd = null)
/* make sure the parent is converted to ng_vlan(4) and is up */
/* make sure the parent is converted to ng_vlan(4) and is up */
interfaces_bring_up
(
$qinqif
);
interfaces_bring_up
(
$qinqif
);
legacy_netgraph_attach
(
$qinqif
);
pfSense_ngctl_attach
(
"."
,
$qinqif
);
if
(
!
empty
(
$vlanif
)
&&
does_interface_exist
(
$vlanif
))
{
if
(
!
empty
(
$vlanif
)
&&
does_interface_exist
(
$vlanif
))
{
fwrite
(
$fd
,
"shutdown
{
$qinqif
}
qinq:
\n
"
);
fwrite
(
$fd
,
"shutdown
{
$qinqif
}
qinq:
\n
"
);
exec
(
"/usr/sbin/ngctl msg
{
$qinqif
}
qinq: gettable"
,
$result
);
exec
(
"/usr/sbin/ngctl msg
{
$qinqif
}
qinq: gettable"
,
$result
);
...
@@ -1614,7 +1614,7 @@ function interface_ppps_configure($interface)
...
@@ -1614,7 +1614,7 @@ function interface_ppps_configure($interface)
case
"pppoe"
:
case
"pppoe"
:
/* Bring the parent interface up */
/* Bring the parent interface up */
interfaces_bring_up
(
$port
);
interfaces_bring_up
(
$port
);
pfSense_ngctl_attach
(
"."
,
$port
);
legacy_netgraph_attach
(
$port
);
/* Enable setautosrc to automatically change mac address if parent interface's changes */
/* Enable setautosrc to automatically change mac address if parent interface's changes */
mwexecf
(
'/usr/sbin/ngctl msg %s: setautosrc 1'
,
array
(
$port
));
mwexecf
(
'/usr/sbin/ngctl msg %s: setautosrc 1'
,
array
(
$port
));
break
;
break
;
...
@@ -1637,7 +1637,7 @@ function interface_ppps_configure($interface)
...
@@ -1637,7 +1637,7 @@ function interface_ppps_configure($interface)
log_error
(
sprintf
(
gettext
(
'Could not get a PPTP/L2TP Remote IP address from %s for %s in interfaces_ppps_configure.'
),
$dhcp_gateway
,
$gway
));
log_error
(
sprintf
(
gettext
(
'Could not get a PPTP/L2TP Remote IP address from %s for %s in interfaces_ppps_configure.'
),
$dhcp_gateway
,
$gway
));
return
0
;
return
0
;
}
}
pfSense_ngctl_attach
(
"."
,
$port
);
legacy_netgraph_attach
(
$port
);
break
;
break
;
case
"ppp"
:
case
"ppp"
:
if
(
!
file_exists
(
"
{
$port
}
"
))
{
if
(
!
file_exists
(
"
{
$port
}
"
))
{
...
...
src/etc/inc/plugins.inc.d/vpn.inc
View file @
1a7e961d
...
@@ -302,7 +302,7 @@ EOD;
...
@@ -302,7 +302,7 @@ EOD;
chmod
(
'/var/etc/pptp-vpn/mpd.secret'
,
0600
);
chmod
(
'/var/etc/pptp-vpn/mpd.secret'
,
0600
);
/* fixed to WAN elsewhere, no need to extend, but at least make it work */
/* fixed to WAN elsewhere, no need to extend, but at least make it work */
pfSense_ngctl_attach
(
'.'
,
get_real_interface
(
'wan'
));
legacy_netgraph_attach
(
get_real_interface
(
'wan'
));
mwexec
(
'/usr/local/sbin/mpd4 -b -d /var/etc/pptp-vpn -p /var/run/pptp-vpn.pid -s pptps pptps'
);
mwexec
(
'/usr/local/sbin/mpd4 -b -d /var/etc/pptp-vpn -p /var/run/pptp-vpn.pid -s pptps pptps'
);
...
@@ -541,7 +541,7 @@ EOD;
...
@@ -541,7 +541,7 @@ EOD;
chmod
(
"/var/etc/pppoe
{
$pppoecfg
[
'pppoeid'
]
}
-vpn/mpd.secret"
,
0600
);
chmod
(
"/var/etc/pppoe
{
$pppoecfg
[
'pppoeid'
]
}
-vpn/mpd.secret"
,
0600
);
}
}
pfSense_ngctl_attach
(
"."
,
$pppoe_interface
);
legacy_netgraph_attach
(
$pppoe_interface
);
mwexec
(
"/usr/local/sbin/mpd4 -b -d /var/etc/pppoe
{
$pppoecfg
[
'pppoeid'
]
}
-vpn -p /var/run/pppoe
{
$pppoecfg
[
'pppoeid'
]
}
-vpn.pid -s poes poes"
);
mwexec
(
"/usr/local/sbin/mpd4 -b -d /var/etc/pppoe
{
$pppoecfg
[
'pppoeid'
]
}
-vpn -p /var/run/pppoe
{
$pppoecfg
[
'pppoeid'
]
}
-vpn.pid -s poes poes"
);
...
@@ -730,7 +730,7 @@ EOD;
...
@@ -730,7 +730,7 @@ EOD;
unset
(
$mpdsecret
);
unset
(
$mpdsecret
);
chmod
(
'/var/etc/l2tp-vpn/mpd.secret'
,
0600
);
chmod
(
'/var/etc/l2tp-vpn/mpd.secret'
,
0600
);
pfSense_ngctl_attach
(
'.'
,
get_real_interface
(
$l2tpcfg
[
'interface'
]));
legacy_netgraph_attach
(
get_real_interface
(
$l2tpcfg
[
'interface'
]));
mwexec
(
'/usr/local/sbin/mpd4 -b -d /var/etc/l2tp-vpn -p /var/run/l2tp-vpn.pid -s l2tps l2tps'
);
mwexec
(
'/usr/local/sbin/mpd4 -b -d /var/etc/l2tp-vpn -p /var/run/l2tp-vpn.pid -s l2tps l2tps'
);
...
...
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