]>
Commit | Line | Data |
---|---|---|
78522c10 MT |
1 | From 6e52cb884e3cab75ca5597b59027a11d982593ab Mon Sep 17 00:00:00 2001 |
2 | From: Boon Ang <boon.s.ang@gmail.com> | |
3 | Date: Thu, 6 Dec 2012 11:01:55 -0600 | |
4 | Subject: [PATCH 09/10] Fix comparison of primary IP addresses. | |
5 | ||
6 | If a router in the master state receives an advertisement with | |
7 | priority equal to the local priority, it must also compare the primary | |
8 | IP addresses (RFC 3768, section 6.4.3). The code to handle this was | |
9 | comparing two IP addresses with different byte-ordering, resulting in | |
10 | multiple routers in the master state. This patches resolves the | |
11 | problem by coverting the local primary IP address to network byte | |
12 | order for the comparison. | |
13 | ||
14 | Signed-off-by: Ryan O'Hara <rohara@redhat.com> | |
15 | --- | |
16 | keepalived/vrrp/vrrp.c | 2 +- | |
17 | 1 files changed, 1 insertions(+), 1 deletions(-) | |
18 | ||
19 | diff --git a/keepalived/vrrp/vrrp.c b/keepalived/vrrp/vrrp.c | |
20 | index 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 | -- | |
33 | 1.7.1 | |
34 |