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;
return
0
;
}
function
services_dhcrelay_configure
()
function
services_dhcrelay_configure
(
$verbose
=
false
)
{
global
$config
;
$dhcrelayifs
=
array
();
/* kill any running dhcrelay */
killbypid
(
'/var/run/dhcrelay.pid'
);
killbypid
(
'/var/run/dhcrelay.pid'
,
'TERM'
,
true
);
$dhcrelaycfg
=
&
$config
[
'dhcrelay'
];
$dhcrelaycfg
=
&
$config
[
'dhcrelay'
];
/* DHCPRelay enabled on any interfaces? */
if
(
!
isset
(
$dhcrelaycfg
[
'enable'
]))
return
0
;
if
(
!
isset
(
$dhcrelaycfg
[
'enable'
]))
{
return
;
}
if
(
file_exists
(
"/var/run/booting"
))
{
echo
gettext
(
"Starting DHCP relay service..."
);
}
else
{
sleep
(
1
);
if
(
$verbose
)
{
echo
'Starting DHCP Relay...'
;
flush
();
}
$iflist
=
get_configured_interface_list
();
...
...
@@ -1459,7 +1458,7 @@ function services_dhcrelay_configure()
/* fire up dhcrelay */
if
(
empty
(
$dhcrelayifs
))
{
log_error
(
"No suitable interface found for running dhcrelay!"
);
return
;
/* XXX */
return
;
}
$cmd
=
"/usr/local/sbin/dhcrelay -i "
.
implode
(
" -i "
,
$dhcrelayifs
);
...
...
@@ -1472,28 +1471,28 @@ function services_dhcrelay_configure()
mwexec
(
$cmd
);
unset
(
$cmd
);
return
0
;
if
(
$verbose
)
{
echo
"done
\n
"
;
}
}
function
services_dhcrelay6_configure
()
function
services_dhcrelay6_configure
(
$verbose
=
false
)
{
global
$config
;
$dhcrelayifs
=
array
();
/* kill any running dhcrelay */
killbypid
(
'/var/run/dhcrelay6.pid'
);
killbypid
(
'/var/run/dhcrelay6.pid'
,
'TERM'
,
true
);
$dhcrelaycfg
=
&
$config
[
'dhcrelay6'
];
$dhcrelaycfg
=
&
$config
[
'dhcrelay6'
];
/* DHCPv6 Relay enabled on any interfaces? */
if
(
!
isset
(
$dhcrelaycfg
[
'enable'
]))
{
return
0
;
return
;
}
if
(
file_exists
(
"/var/run/booting"
))
{
echo
gettext
(
"Starting DHCPv6 relay service..."
);
}
else
{
sleep
(
1
);
if
(
$verbose
)
{
echo
'Starting DHCPv6 Relay...'
;
flush
();
}
$iflist
=
get_configured_interface_list
();
...
...
@@ -1578,7 +1577,7 @@ function services_dhcrelay6_configure()
/* fire up dhcrelay */
if
(
empty
(
$dhcrelayifs
)
||
empty
(
$srvifaces
)
)
{
log_error
(
"No suitable interface found for running dhcrelay -6!"
);
return
;
/* XXX */
return
;
}
$cmd
=
'/usr/local/sbin/dhcrelay -6 -pf /var/run/dhcrelay6.pid'
;
...
...
@@ -1591,7 +1590,9 @@ function services_dhcrelay6_configure()
mwexec
(
$cmd
);
unset
(
$cmd
);
return
0
;
if
(
$verbose
)
{
echo
"done
\n
"
;
}
}
function
services_dyndns_list
()
...
...
src/etc/rc.bootup
View file @
9a5d36ae
...
...
@@ -184,17 +184,10 @@ services_dnsmasq_configure(true);
/* start unbound service */
services_unbound_configure
(
true
);
/* start DHCP service */
services_dhcpd_configure
();
/* start dhcpleases dhpcp hosts leases program */
services_dhcpleases_configure
();
/* start DHCP relay */
services_dhcrelay_configure
();
/* start DHCP6 relay */
services_dhcrelay6_configure
();
services_dhcrelay_configure
(
true
);
services_dhcrelay6_configure
(
true
);
/* dyndns service updates */
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