Commit 37560183 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

CARP, add option "Disable preempt", move preempt to later boot stage. for...

CARP, add option "Disable preempt", move preempt to later boot stage. for https://github.com/opnsense/core/issues/1557

(cherry picked from commit 75967381)
(cherry picked from commit 4c01a935)
(cherry picked from commit f399f3fa)
(cherry picked from commit 15f48662)
parent 841443c2
......@@ -139,6 +139,7 @@
/usr/local/etc/rc.syshook.d/20-freebsd.start
/usr/local/etc/rc.syshook.d/80-freebsd.stop
/usr/local/etc/rc.syshook.d/90-backup.stop
/usr/local/etc/rc.syshook.d/90-carp.start
/usr/local/etc/rc.syshook.d/90-cron.start
/usr/local/etc/rc.syshook.d/95-beep.start
/usr/local/etc/rc.update_alias_url_data
......
......@@ -1678,8 +1678,6 @@ function interfaces_carp_setup($verbose = false)
flush();
}
set_single_sysctl("net.inet.carp.preempt", "1");
if (!empty($config['hasync']['pfsyncinterface'])) {
$carp_sync_int = get_real_interface($config['hasync']['pfsyncinterface']);
}
......
#!/usr/local/bin/php
<?php
/*
* Copyright (C) 2017 Ad Schellevis <ad@opnsense.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
require_once("util.inc");
require_once("config.inc");
if (empty($config['hasync']) || empty($config['hasync']['disablepreempt'])) {
set_single_sysctl("net.inet.carp.preempt", "1");
}
......@@ -37,6 +37,7 @@ $a_hasync = &$config['hasync'];
$checkbox_names = array(
'pfsyncenabled',
'disablepreempt',
'synchronizealiases',
'synchronizeauthservers',
'synchronizecerts',
......@@ -99,12 +100,12 @@ include("head.inc");
<body>
<?php include("fbegin.inc"); ?>
<section class="page-content-main">
<form method="post">
<div class="container-fluid">
<div class="row">
<section class="col-xs-12">
<div class="content-box">
<div class="tab-content content-box col-xs-12 __mb">
<div class="table-responsive">
<form method="post">
<table class="table table-striped opnsense_standard_table_form">
<tr>
<td width="22%"><strong><?=gettext('State Synchronization') ?></strong></td>
......@@ -126,6 +127,15 @@ include("head.inc");
</div>
</td>
</tr>
<tr>
<td><a id="help_for_disablepreempt" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext('Disable preempt') ?></td>
<td>
<input type="checkbox" name="disablepreempt" value="on" <?= !empty($pconfig['disablepreempt']) ? "checked=\"checked\"" : "";?> />
<div class="hidden" for="help_for_disablepreempt">
<?=gettext("When this device is configured as CARP master it will try to switch to master when powering up, this option will keep this one slave if there already is a master on the network");?>
</div>
</td>
</tr>
<tr>
<td><a id="help_for_pfsyncinterface" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext('Synchronize Interface') ?></td>
<td>
......@@ -162,6 +172,12 @@ include("head.inc");
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="tab-content content-box col-xs-12 __mb">
<div class="table-responsive">
<table class="table table-striped opnsense_standard_table_form">
<tr>
<th colspan="2" class="listtopic"><?=gettext('Configuration Synchronization Settings (XMLRPC Sync)') ?></th>
</tr>
......@@ -316,12 +332,12 @@ include("head.inc");
</td>
</tr>
</table>
</form>
</div>
</div>
</section>
</div>
</div>
</form>
</section>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment