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
9a5d36ae
Commit
9a5d36ae
authored
Nov 14, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dhcprelay: port to #1256
(cherry picked from commit
203732a9
)
parent
42290252
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
34 deletions
+28
-34
services.inc
src/etc/inc/services.inc
+26
-25
rc.bootup
src/etc/rc.bootup
+2
-9
No files found.
src/etc/inc/services.inc
View file @
9a5d36ae
...
@@ -1353,24 +1353,23 @@ EOD;
...
@@ -1353,24 +1353,23 @@ EOD;
return
0
;
return
0
;
}
}
function
services_dhcrelay_configure
()
function
services_dhcrelay_configure
(
$verbose
=
false
)
{
{
global
$config
;
global
$config
;
$dhcrelayifs
=
array
();
$dhcrelayifs
=
array
();
/* kill any running dhcrelay */
killbypid
(
'/var/run/dhcrelay.pid'
,
'TERM'
,
true
);
killbypid
(
'/var/run/dhcrelay.pid'
);
$dhcrelaycfg
=
&
$config
[
'dhcrelay'
];
$dhcrelaycfg
=
&
$config
[
'dhcrelay'
];
/* DHCPRelay enabled on any interfaces? */
if
(
!
isset
(
$dhcrelaycfg
[
'enable'
]))
{
if
(
!
isset
(
$dhcrelaycfg
[
'enable'
]))
return
;
return
0
;
}
if
(
file_exists
(
"/var/run/booting"
))
{
if
(
$verbose
)
{
echo
gettext
(
"Starting DHCP relay service..."
);
echo
'Starting DHCP Relay...'
;
}
else
{
flush
();
sleep
(
1
);
}
}
$iflist
=
get_configured_interface_list
();
$iflist
=
get_configured_interface_list
();
...
@@ -1459,7 +1458,7 @@ function services_dhcrelay_configure()
...
@@ -1459,7 +1458,7 @@ function services_dhcrelay_configure()
/* fire up dhcrelay */
/* fire up dhcrelay */
if
(
empty
(
$dhcrelayifs
))
{
if
(
empty
(
$dhcrelayifs
))
{
log_error
(
"No suitable interface found for running dhcrelay!"
);
log_error
(
"No suitable interface found for running dhcrelay!"
);
return
;
/* XXX */
return
;
}
}
$cmd
=
"/usr/local/sbin/dhcrelay -i "
.
implode
(
" -i "
,
$dhcrelayifs
);
$cmd
=
"/usr/local/sbin/dhcrelay -i "
.
implode
(
" -i "
,
$dhcrelayifs
);
...
@@ -1472,28 +1471,28 @@ function services_dhcrelay_configure()
...
@@ -1472,28 +1471,28 @@ function services_dhcrelay_configure()
mwexec
(
$cmd
);
mwexec
(
$cmd
);
unset
(
$cmd
);
unset
(
$cmd
);
return
0
;
if
(
$verbose
)
{
echo
"done
\n
"
;
}
}
}
function
services_dhcrelay6_configure
()
function
services_dhcrelay6_configure
(
$verbose
=
false
)
{
{
global
$config
;
global
$config
;
$dhcrelayifs
=
array
();
$dhcrelayifs
=
array
();
/* kill any running dhcrelay */
killbypid
(
'/var/run/dhcrelay6.pid'
,
'TERM'
,
true
);
killbypid
(
'/var/run/dhcrelay6.pid'
);
$dhcrelaycfg
=
&
$config
[
'dhcrelay6'
];
$dhcrelaycfg
=
&
$config
[
'dhcrelay6'
];
/* DHCPv6 Relay enabled on any interfaces? */
if
(
!
isset
(
$dhcrelaycfg
[
'enable'
]))
{
if
(
!
isset
(
$dhcrelaycfg
[
'enable'
]))
{
return
0
;
return
;
}
}
if
(
file_exists
(
"/var/run/booting"
))
{
if
(
$verbose
)
{
echo
gettext
(
"Starting DHCPv6 relay service..."
);
echo
'Starting DHCPv6 Relay...'
;
}
else
{
flush
();
sleep
(
1
);
}
}
$iflist
=
get_configured_interface_list
();
$iflist
=
get_configured_interface_list
();
...
@@ -1578,7 +1577,7 @@ function services_dhcrelay6_configure()
...
@@ -1578,7 +1577,7 @@ function services_dhcrelay6_configure()
/* fire up dhcrelay */
/* fire up dhcrelay */
if
(
empty
(
$dhcrelayifs
)
||
empty
(
$srvifaces
)
)
{
if
(
empty
(
$dhcrelayifs
)
||
empty
(
$srvifaces
)
)
{
log_error
(
"No suitable interface found for running dhcrelay -6!"
);
log_error
(
"No suitable interface found for running dhcrelay -6!"
);
return
;
/* XXX */
return
;
}
}
$cmd
=
'/usr/local/sbin/dhcrelay -6 -pf /var/run/dhcrelay6.pid'
;
$cmd
=
'/usr/local/sbin/dhcrelay -6 -pf /var/run/dhcrelay6.pid'
;
...
@@ -1591,7 +1590,9 @@ function services_dhcrelay6_configure()
...
@@ -1591,7 +1590,9 @@ function services_dhcrelay6_configure()
mwexec
(
$cmd
);
mwexec
(
$cmd
);
unset
(
$cmd
);
unset
(
$cmd
);
return
0
;
if
(
$verbose
)
{
echo
"done
\n
"
;
}
}
}
function
services_dyndns_list
()
function
services_dyndns_list
()
...
...
src/etc/rc.bootup
View file @
9a5d36ae
...
@@ -184,17 +184,10 @@ services_dnsmasq_configure(true);
...
@@ -184,17 +184,10 @@ services_dnsmasq_configure(true);
/* start unbound service */
/* start unbound service */
services_unbound_configure
(
true
);
services_unbound_configure
(
true
);
/* start DHCP service */
services_dhcpd_configure
();
services_dhcpd_configure
();
/* start dhcpleases dhpcp hosts leases program */
services_dhcpleases_configure
();
services_dhcpleases_configure
();
services_dhcrelay_configure
(
true
);
/* start DHCP relay */
services_dhcrelay6_configure
(
true
);
services_dhcrelay_configure
();
/* start DHCP6 relay */
services_dhcrelay6_configure
();
/* dyndns service updates */
/* dyndns service updates */
mwexec
(
"/usr/local/etc/rc.dyndns.update"
);
mwexec
(
"/usr/local/etc/rc.dyndns.update"
);
...
...
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