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
e2998ac4
Commit
e2998ac4
authored
Jul 16, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interfaces: skip rtsold in case required by ISP for #637
parent
b1161dfd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
23 deletions
+43
-23
interfaces.inc
src/etc/inc/interfaces.inc
+30
-23
interfaces.php
src/www/interfaces.php
+13
-0
No files found.
src/etc/inc/interfaces.inc
View file @
e2998ac4
...
...
@@ -3419,7 +3419,7 @@ function interface_dhcpv6_configure($interface = 'wan', $wancfg)
$dhcp6cscript
=
"#!/bin/sh
\n
"
;
$dhcp6cscript
.=
"# This shell script launches /usr/local/etc/rc.newwanipv6 with a interface argument.
\n
"
;
$dhcp6cscript
.=
"/usr/local/etc/rc.newwanipv6
{
$wanif
}
\n
"
;
/* Add wide-dhcp6c shell script here. Because we can not pass a argument to it. */
if
(
!@
file_put_contents
(
"/var/etc/dhcp6c_
{
$interface
}
_script.sh"
,
$dhcp6cscript
))
{
printf
(
"Error: cannot open dhcp6c_
{
$interface
}
_script.sh in interface_dhcpv6_configure() for writing.
\n
"
);
unset
(
$dhcp6cscript
);
...
...
@@ -3428,6 +3428,16 @@ function interface_dhcpv6_configure($interface = 'wan', $wancfg)
unset
(
$dhcp6cscript
);
chmod
(
"/var/etc/dhcp6c_
{
$interface
}
_script.sh"
,
0755
);
$dhcp6ccommand
=
exec_safe
(
"/usr/local/sbin/dhcp6c %s -c %s -p %s %s"
,
array
(
empty
(
$wancfg
[
'adv_dhcp6_debug'
])
?
'-d'
:
'-D'
,
"/var/etc/dhcp6c_
{
$interface
}
.conf"
,
"/var/run/dhcp6c_
{
$wanif
}
.pid"
,
"
{
$wanif
}
"
)
);
$rtsoldscript
=
"#!/bin/sh
\n
"
;
$rtsoldscript
.=
"# This shell script launches dhcp6c and configured gateways for this interface.
\n
"
;
$rtsoldscript
.=
"echo $2 > /tmp/
{
$wanif
}
_routerv6
\n
"
;
...
...
@@ -3436,10 +3446,9 @@ function interface_dhcpv6_configure($interface = 'wan', $wancfg)
$rtsoldscript
.=
"
\t
/bin/pkill -F /var/run/dhcp6c_
{
$wanif
}
.pid
\n
"
;
$rtsoldscript
.=
"
\t
/bin/sleep 1
\n
"
;
$rtsoldscript
.=
"fi
\n
"
;
$rtsoldscript
.=
"/usr/local/sbin/dhcp6c "
.
(
empty
(
$wancfg
[
'adv_dhcp6_debug'
])
?
'-d'
:
'-D'
)
;
$rtsoldscript
.=
" -c /var/etc/dhcp6c_
{
$interface
}
.conf -p /var/run/dhcp6c_
{
$wanif
}
.pid
{
$wanif
}
\n
"
;
$rtsoldscript
.=
"/usr/bin/logger -t rtsold
\"
Starting dhcp6 client for interface
{
$interface
}
(
{
$wanif
}
)
\"\n
"
;
/* Add wide-dhcp6c shell script here. Because we can not pass a argument to it. */
$rtsoldscript
.=
"
$dhcp6ccommand
\n
"
;
if
(
!@
file_put_contents
(
"/var/etc/rtsold_
{
$wanif
}
_script.sh"
,
$rtsoldscript
))
{
printf
(
"Error: cannot open rtsold_
{
$wanif
}
_script.sh in interface_dhcpv6_configure() for writing.
\n
"
);
unset
(
$rtsoldscript
);
...
...
@@ -3456,26 +3465,24 @@ function interface_dhcpv6_configure($interface = 'wan', $wancfg)
/* Enable RFC6204w support for IPv6 Customer Edge (CE) router */
set_single_sysctl
(
"net.inet6.ip6.rfc6204w3"
,
"1"
);
/* fire up rtsold for IPv6 RAs first, this backgrounds immediately. It will call dhcp6c */
if
(
isvalidpid
(
"/var/run/rtsold_
{
$wanif
}
.pid"
))
{
killbypid
(
"/var/run/rtsold_
{
$wanif
}
.pid"
);
sleep
(
2
);
}
mwexecf
(
'/usr/sbin/rtsold -p %s -O %s -R %s %s %s'
,
array
(
"/var/run/rtsold_
{
$wanif
}
.pid"
,
"/var/etc/rtsold_
{
$wanif
}
_script.sh"
,
'/usr/bin/true'
,
/* XXX missing proper script to refresh resolv.conf */
empty
(
$wancfg
[
'adv_dhcp6_debug'
])
?
'-d'
:
'-D'
,
$wanif
)
);
killbypid
(
"/var/run/rtsold_
{
$wanif
}
.pid"
,
'TERM'
,
true
);
/* NOTE: will be called from rtsold invoked script
* link_interface_to_track6($interface, "update");
*/
if
(
isset
(
$wancfg
[
'dhcp6sendsolicit'
]))
{
/* command is already exec_safe() */
mwexec
(
$dhcp6ccommand
);
}
else
{
/* fire up rtsold for IPv6 RAs first, this backgrounds immediately. It will call dhcp6c */
mwexecf
(
'/usr/sbin/rtsold -p %s -O %s -R %s %s %s'
,
array
(
"/var/run/rtsold_
{
$wanif
}
.pid"
,
"/var/etc/rtsold_
{
$wanif
}
_script.sh"
,
'/usr/bin/true'
,
/* XXX missing proper script to refresh resolv.conf */
empty
(
$wancfg
[
'adv_dhcp6_debug'
])
?
'-d'
:
'-D'
,
$wanif
)
);
}
return
0
;
}
...
...
src/www/interfaces.php
View file @
e2998ac4
...
...
@@ -371,6 +371,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig
[
'blockpriv'
]
=
isset
(
$a_interfaces
[
$if
][
'blockpriv'
]);
$pconfig
[
'blockbogons'
]
=
isset
(
$a_interfaces
[
$if
][
'blockbogons'
]);
$pconfig
[
'dhcp6-ia-pd-send-hint'
]
=
isset
(
$a_interfaces
[
$if
][
'dhcp6-ia-pd-send-hint'
]);
$pconfig
[
'dhcp6sendsolicit'
]
=
isset
(
$a_interfaces
[
$if
][
'dhcp6sendsolicit'
]);
$pconfig
[
'dhcp6prefixonly'
]
=
isset
(
$a_interfaces
[
$if
][
'dhcp6prefixonly'
]);
$pconfig
[
'dhcp6usev4iface'
]
=
isset
(
$a_interfaces
[
$if
][
'dhcp6usev4iface'
]);
$pconfig
[
'adv_dhcp6_debug'
]
=
isset
(
$a_interfaces
[
$if
][
'adv_dhcp6_debug'
]);
...
...
@@ -1060,6 +1061,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if
(
!
empty
(
$pconfig
[
'dhcp6prefixonly'
]))
{
$new_config
[
'dhcp6prefixonly'
]
=
true
;
}
if
(
!
empty
(
$pconfig
[
'dhcp6sendsolicit'
]))
{
$new_config
[
'dhcp6sendsolicit'
]
=
true
;
}
if
(
!
empty
(
$pconfig
[
'dhcp6usev4iface'
]))
{
$new_config
[
'dhcp6usev4iface'
]
=
true
;
}
...
...
@@ -2460,6 +2464,15 @@ include("head.inc");
</div>
</td>
</tr>
<tr
class=
"dhcpv6_basic"
>
<td><a
id=
"help_for_dhcp6sendsolicit"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
'Directly send SOLICIT'
);
?>
</td>
<td>
<input
name=
"dhcp6sendsolicit"
type=
"checkbox"
id=
"dhcp6sendsolicit"
value=
"yes"
<?=
!
empty
(
$pconfig
[
'dhcp6sendsolicit'
])
?
'checked="checked"'
:
''
?>
/>
<div
class=
"hidden"
for=
"help_for_dhcp6sendsolicit"
>
<?=
gettext
(
'In case the ISP requires a SOLICIT message for authentication, select this option to prevent indefinite waiting for a router advertisement.'
)
?>
</div>
</td>
</tr>
<tr
class=
"dhcpv6_basic"
>
<td><a
id=
"help_for_dhcp6-ia-pd-len"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"DHCPv6 Prefix Delegation size"
);
?>
</td>
<td>
...
...
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