Add patch to revert previous preempt extension (#1202584)

This commit is contained in:
Ryan O'Hara 2015-03-18 08:58:30 -05:00
parent b15d6c5a66
commit 7424b42dcf

View File

@ -0,0 +1,67 @@
From 2bab517b2b50c1e784e79a082d971f4855e9e0ab Mon Sep 17 00:00:00 2001
From: Alexandre Cassen <acassen@gmail.com>
Date: Tue, 17 Mar 2015 21:07:36 +0100
Subject: [PATCH] vrrp: revert previous preempt extension
Well, nothing more to add ;)
---
keepalived/vrrp/vrrp.c | 22 ++++++----------------
1 file changed, 6 insertions(+), 16 deletions(-)
diff --git a/keepalived/vrrp/vrrp.c b/keepalived/vrrp/vrrp.c
index 21481f4..db43f8f 100644
--- a/keepalived/vrrp/vrrp.c
+++ b/keepalived/vrrp/vrrp.c
@@ -819,8 +819,7 @@ vrrp_state_goto_master(vrrp_t * vrrp)
return;
}
- if (!vrrp->nopreempt)
- vrrp_send_adv(vrrp, vrrp->effective_priority);
+ vrrp_send_adv(vrrp, vrrp->effective_priority);
vrrp->state = VRRP_STATE_MAST;
log_message(LOG_INFO, "VRRP_Instance(%s) Transition to MASTER STATE"
@@ -999,19 +998,7 @@ vrrp_state_master_rx(vrrp_t * vrrp, char *buf, int buflen)
"VRRP_Instance(%s) Dropping received VRRP packet...",
vrrp->iname);
return 0;
- } else if (hd->priority == 0) {
- vrrp_send_adv(vrrp, vrrp->effective_priority);
- return 0;
- } else if (hd->priority < vrrp->effective_priority ||
- (hd->priority == vrrp->effective_priority &&
- vrrp_saddr_cmp(&vrrp->pkt_saddr, vrrp) < 0)) {
- /* In nopreempt mode, just switch to BACKUP */
- if (vrrp->nopreempt) {
- log_message(LOG_INFO, "VRRP_Instance(%s) Received lower prio advert"
- " in nopreempt mode", vrrp->iname);
- goto backup;
- }
-
+ } else if (hd->priority < vrrp->effective_priority) {
/* We receive a lower prio adv we just refresh remote ARP cache */
log_message(LOG_INFO, "VRRP_Instance(%s) Received lower prio advert"
", forcing new election", vrrp->iname);
@@ -1026,6 +1013,9 @@ vrrp_state_master_rx(vrrp_t * vrrp, char *buf, int buflen)
vrrp_send_adv(vrrp, vrrp->effective_priority);
vrrp_send_link_update(vrrp, vrrp->garp_rep);
return 0;
+ } else if (hd->priority == 0) {
+ vrrp_send_adv(vrrp, vrrp->effective_priority);
+ return 0;
} else if (hd->priority > vrrp->effective_priority ||
(hd->priority == vrrp->effective_priority &&
vrrp_saddr_cmp(&vrrp->pkt_saddr, vrrp) > 0)) {
@@ -1044,7 +1034,7 @@ vrrp_state_master_rx(vrrp_t * vrrp, char *buf, int buflen)
vrrp->ipsecah_counter->seq_number = ntohl(ah->seq_number) - 1;
vrrp->ipsecah_counter->cycle = 0;
}
- backup:
+
vrrp->ms_down_timer = 3 * vrrp->adver_int + VRRP_TIMER_SKEW(vrrp);
vrrp->wantstate = VRRP_STATE_BACK;
vrrp->state = VRRP_STATE_BACK;
--
1.9.3