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
b2f28859
Commit
b2f28859
authored
Apr 12, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system: partially merge cleanups from
dec52fa6
parent
665b3c2d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
28 deletions
+18
-28
system.inc
src/etc/inc/system.inc
+8
-9
util.inc
src/etc/inc/util.inc
+6
-6
system_advanced_network.php
src/www/system_advanced_network.php
+4
-13
No files found.
src/etc/inc/system.inc
View file @
b2f28859
...
...
@@ -1773,19 +1773,18 @@ function system_console_configure()
function
system_setup_sysctl
()
{
global
$config
;
activate_sysctls
();
if
(
isset
(
$config
[
'system'
][
'sharednet'
]))
{
system_disable_arp_wrong_if
();
}
system_arp_wrong_if
();
}
function
system_
disable_
arp_wrong_if
()
function
system_arp_wrong_if
()
{
set_sysctl
(
array
(
"net.link.ether.inet.log_arp_wrong_iface"
=>
"0"
,
"net.link.ether.inet.log_arp_movements"
=>
"0"
));
global
$config
;
set_sysctl
(
array
(
'net.link.ether.inet.log_arp_wrong_iface'
=>
isset
(
$config
[
'system'
][
'sharednet'
])
?
'0'
:
'1'
,
'net.link.ether.inet.log_arp_movements'
=>
isset
(
$config
[
'system'
][
'sharednet'
])
?
'0'
:
'1'
,
));
}
function
get_possible_listen_ips
(
$include_ipv6_link_local
=
false
)
{
...
...
src/etc/inc/util.inc
View file @
b2f28859
...
...
@@ -1357,12 +1357,12 @@ function get_alias_list($type = null)
return
$result
;
}
/* Define what is preferred, IPv4 or IPv6 */
function
prefer_ipv4_or_ipv6
()
{
function
prefer_ipv4_or_ipv6
()
{
global
$config
;
if
(
isset
(
$config
[
'system'
][
'prefer_ipv4'
]))
mwexec
(
"/etc/rc.d/ip6addrctl prefer_ipv4"
);
else
mwexec
(
"/etc/rc.d/ip6addrctl prefer_ipv6"
);
mwexecf
(
'/etc/rc.d/ip6addrctl %s'
,
isset
(
$config
[
'system'
][
'prefer_ipv4'
])
?
'prefer_ipv4'
:
'prefer_ipv6'
);
}
src/www/system_advanced_network.php
View file @
b2f28859
...
...
@@ -117,18 +117,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
if
(
count
(
$input_errors
)
==
0
)
{
setup_polling
();
if
(
isset
(
$config
[
'system'
][
'sharednet'
]))
{
system_disable_arp_wrong_if
();
}
else
{
// system_enable_arp_wrong_if
set_sysctl
(
array
(
"net.link.ether.inet.log_arp_wrong_iface"
=>
"1"
,
"net.link.ether.inet.log_arp_movements"
=>
"1"
));
}
write_config
();
setup_polling
();
system_arp_wrong_if
();
prefer_ipv4_or_ipv6
();
filter_configure
();
header
(
"Location: system_advanced_network.php"
);
...
...
@@ -189,8 +180,8 @@ include("head.inc");
<td><a
id=
"help_for_ipv6allow"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Allow IPv6"
);
?>
</td>
<td>
<input
name=
"ipv6allow"
type=
"checkbox"
value=
"yes"
<?=
!
empty
(
$pconfig
[
'ipv6allow'
])
?
"checked=
\"
checked
\"
"
:
""
;
?>
onclick=
"enable_change(false)"
/>
<strong>
<?=
gettext
(
"Allow IPv6"
);
?>
</strong>
<div
class=
"hidden"
for=
"help_for_ipv6allow"
>
<strong>
<?=
gettext
(
"Allow IPv6"
);
?>
</strong><br
/>
<?=
gettext
(
"All IPv6 traffic will be blocked by the firewall unless this box is checked."
);
?>
<br
/>
<?=
gettext
(
"NOTE: This does not disable any IPv6 features on the firewall, it only blocks traffic."
);
?>
<br
/>
</div>
...
...
@@ -215,8 +206,8 @@ include("head.inc");
<td><a
id=
"help_for_prefer_ipv4"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Prefer IPv4 over IPv6"
);
?>
</td>
<td>
<input
name=
"prefer_ipv4"
type=
"checkbox"
id=
"prefer_ipv4"
value=
"yes"
<?=
!
empty
(
$config
[
'system'
][
'prefer_ipv4'
])
?
"checked=
\"
checked
\"
"
:
""
;
?>
/>
<strong>
<?=
gettext
(
"Prefer to use IPv4 even if IPv6 is available"
);
?>
</strong>
<div
class=
"hidden"
for=
"help_for_prefer_ipv4"
>
<strong>
<?=
gettext
(
"Prefer to use IPv4 even if IPv6 is available"
);
?>
</strong><br
/>
<?=
gettext
(
"By default, if a hostname resolves IPv6 and IPv4 addresses "
.
"IPv6 will be used, if you check this option, IPv4 will be "
.
"used instead of IPv6."
);
?>
...
...
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