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
f3597390
Commit
f3597390
authored
Feb 16, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: fix a few crash reports
parent
4f5144f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
23 deletions
+29
-23
unbound.inc
src/etc/inc/unbound.inc
+15
-14
carp_status.php
src/www/carp_status.php
+7
-4
services_unbound.php
src/www/services_unbound.php
+7
-5
No files found.
src/etc/inc/unbound.inc
View file @
f3597390
...
...
@@ -73,24 +73,25 @@ function unbound_optimization() {
* Larger socket buffer for busy servers
* Check that it is set to 4MB (by default the OS has it configured to 4MB)
*/
foreach
(
$config
[
'sysctl'
][
'item'
]
as
$tunable
)
{
if
(
$tunable
[
'tunable'
]
==
'kern.ipc.maxsockbuf'
)
{
$so
=
floor
((
$tunable
[
'value'
]
/
1024
/
1024
)
-
1
);
// Check to ensure that the number is not a negative
if
(
$so
>
0
)
{
$optimization
[
'so_rcvbuf'
]
=
"so-rcvbuf:
{
$so
}
m"
;
}
else
{
unset
(
$optimization
[
'so_rcvbuf'
]);
if
(
isset
(
$config
[
'sysctl'
][
'item'
]))
{
foreach
(
$config
[
'sysctl'
][
'item'
]
as
$tunable
)
{
if
(
$tunable
[
'tunable'
]
==
'kern.ipc.maxsockbuf'
)
{
$so
=
floor
((
$tunable
[
'value'
]
/
1024
/
1024
)
-
1
);
// Check to ensure that the number is not a negative
if
(
$so
>
0
)
{
$optimization
[
'so_rcvbuf'
]
=
"so-rcvbuf:
{
$so
}
m"
;
}
else
{
unset
(
$optimization
[
'so_rcvbuf'
]);
}
}
}
}
// Safety check in case kern.ipc.maxsockbuf is not available.
if
(
!
isset
(
$optimization
[
'so_rcvbuf'
]))
{
$optimization
[
'so_rcvbuf'
]
=
"#so-rcvbuf: 4m"
;
// Safety check in case kern.ipc.maxsockbuf is not available.
if
(
!
isset
(
$optimization
[
'so_rcvbuf'
]))
{
$optimization
[
'so_rcvbuf'
]
=
"#so-rcvbuf: 4m"
;
}
}
return
$optimization
;
}
function
bootstrap_unbound_root
()
...
...
@@ -701,7 +702,7 @@ function unbound_acls_config() {
}
// Configure the custom ACLs
if
(
is
_array
(
$config
[
'unbound'
][
'acls'
]))
{
if
(
is
set
(
$config
[
'unbound'
][
'acls'
]))
{
foreach
(
$config
[
'unbound'
][
'acls'
]
as
$unbound_acl
)
{
$aclcfg
.=
"#
{
$unbound_acl
[
'aclname'
]
}
\n
"
;
foreach
(
$unbound_acl
[
'row'
]
as
$network
)
{
...
...
src/www/carp_status.php
View file @
f3597390
...
...
@@ -34,6 +34,7 @@ require_once("interfaces.inc");
function
interfaces_carp_set_maintenancemode
(
$carp_maintenancemode
)
{
global
$config
;
if
(
isset
(
$config
[
"virtualip_carp_maintenancemode"
])
&&
$carp_maintenancemode
==
false
)
{
unset
(
$config
[
"virtualip_carp_maintenancemode"
]);
write_config
(
"Leave CARP maintenance mode"
);
...
...
@@ -42,10 +43,12 @@ function interfaces_carp_set_maintenancemode($carp_maintenancemode)
write_config
(
"Enter CARP maintenance mode"
);
}
$viparr
=
&
$config
[
'virtualip'
][
'vip'
];
foreach
(
$viparr
as
$vip
)
{
if
(
$vip
[
'mode'
]
==
"carp"
)
{
interface_carp_configure
(
$vip
);
if
(
isset
(
$config
[
'virtualip'
][
'vip'
]))
{
$viparr
=
&
$config
[
'virtualip'
][
'vip'
];
foreach
(
$viparr
as
$vip
)
{
if
(
$vip
[
'mode'
]
==
'carp'
)
{
interface_carp_configure
(
$vip
);
}
}
}
}
...
...
src/www/services_unbound.php
View file @
f3597390
...
...
@@ -212,9 +212,10 @@ function show_advanced_dns() {
<option
value=
""
<?php
if
(
empty
(
$pconfig
[
'active_interface'
])
||
empty
(
$pconfig
[
'active_interface'
][
0
]))
echo
'selected="selected"'
;
?>
>
All
</option>
<?php
foreach
(
$interface_addresses
as
$laddr
)
:
$selected
=
""
;
if
(
in_array
(
$laddr
[
'value'
],
$pconfig
[
'active_interface'
]))
$selected
=
''
;
if
(
!
empty
(
$pconfig
[
'active_interface'
])
&&
in_array
(
$laddr
[
'value'
],
$pconfig
[
'active_interface'
]))
{
$selected
=
'selected="selected"'
;
}
?>
<option
value=
"
<?=
$laddr
[
'value'
];
?>
"
<?=
$selected
;
?>
>
<?=
htmlspecialchars
(
$laddr
[
'name'
]);
?>
...
...
@@ -237,9 +238,10 @@ function show_advanced_dns() {
<option
value=
""
<?php
if
(
empty
(
$pconfig
[
'outgoing_interface'
])
||
empty
(
$pconfig
[
'outgoing_interface'
][
0
]))
echo
'selected="selected"'
;
?>
>
All
</option>
<?php
foreach
(
$interface_addresses
as
$laddr
)
:
$selected
=
""
;
if
(
in_array
(
$laddr
[
'value'
],
$pconfig
[
'outgoing_interface'
]))
$selected
=
'selected="selected"'
;
$selected
=
''
;
if
(
!
empty
(
$pconfig
[
'outgoing_interface'
])
&&
in_array
(
$laddr
[
'value'
],
$pconfig
[
'outgoing_interface'
]))
{
$selected
=
'selected="selected"'
;
}
?>
<option
value=
"
<?=
$laddr
[
'value'
];
?>
"
<?=
$selected
;
?>
>
<?=
htmlspecialchars
(
$laddr
[
'name'
]);
?>
...
...
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