]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blame - keepalived/patches/keepalived-1.2.7-fix-primary-ip-address-comparison.patch
tmux: Update to 2.2
[people/amarx/ipfire-3.x.git] / keepalived / patches / keepalived-1.2.7-fix-primary-ip-address-comparison.patch
CommitLineData
78522c10
MT
1From 6e52cb884e3cab75ca5597b59027a11d982593ab Mon Sep 17 00:00:00 2001
2From: Boon Ang <boon.s.ang@gmail.com>
3Date: Thu, 6 Dec 2012 11:01:55 -0600
4Subject: [PATCH 09/10] Fix comparison of primary IP addresses.
5
6If a router in the master state receives an advertisement with
7priority equal to the local priority, it must also compare the primary
8IP addresses (RFC 3768, section 6.4.3). The code to handle this was
9comparing two IP addresses with different byte-ordering, resulting in
10multiple routers in the master state. This patches resolves the
11problem by coverting the local primary IP address to network byte
12order for the comparison.
13
14Signed-off-by: Ryan O'Hara <rohara@redhat.com>
15---
16 keepalived/vrrp/vrrp.c | 2 +-
17 1 files changed, 1 insertions(+), 1 deletions(-)
18
19diff --git a/keepalived/vrrp/vrrp.c b/keepalived/vrrp/vrrp.c
20index 0a8bc3f..a88deb3 100644
21--- a/keepalived/vrrp/vrrp.c
22+++ b/keepalived/vrrp/vrrp.c
23@@ -923,7 +923,7 @@ vrrp_state_master_rx(vrrp_rt * vrrp, char *buf, int buflen)
24 } else if (vrrp->family == AF_INET) {
25 if (hd->priority > vrrp->effective_priority ||
26 (hd->priority == vrrp->effective_priority &&
27- ntohl(saddr) > VRRP_PKT_SADDR(vrrp))) {
28+ ntohl(saddr) > ntohl(VRRP_PKT_SADDR(vrrp)))) {
29 log_message(LOG_INFO, "VRRP_Instance(%s) Received higher prio advert"
30 , vrrp->iname);
31 if (proto == IPPROTO_IPSEC_AH) {
32--
331.7.1
34