Skip to content

Commit

Permalink
Improve the log message when a master receives higher priority advert
Browse files Browse the repository at this point in the history
The log message reported in issue #754
"VRRP_Instance(VI_1) Received advert with higher priority 253, ours 253"
is somewhat misleading since 253 == 253.

This commit improves the log message in this case be reporting that
the sender's IP address is higher and the priority is equal. It also
states the it was a master receiving the advert.

Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
  • Loading branch information
pqarmitage committed Jan 18, 2018
1 parent 4955985 commit 531f2e7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions keepalived/vrrp/vrrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1727,8 +1727,12 @@ vrrp_state_master_rx(vrrp_t * vrrp, char *buf, ssize_t buflen)
(hd->priority == vrrp->effective_priority &&
addr_cmp > 0)) {

log_message(LOG_INFO, "VRRP_Instance(%s) Received advert with higher priority %d, ours %d"
, vrrp->iname, hd->priority, vrrp->effective_priority);
if (hd->priority > vrrp->effective_priority)
log_message(LOG_INFO, "VRRP_Instance(%s) Master received advert with higher priority %d, ours %d"
, vrrp->iname, hd->priority, vrrp->effective_priority);
else
log_message(LOG_INFO, "VRRP_Instance(%s) Master received advert with same priority %d but higher IP address than ours (%s)"
, vrrp->iname, hd->priority, inet_sockaddrtos(&vrrp->pkt_saddr));
#ifdef _WITH_VRRP_AUTH_
if (proto == IPPROTO_IPSEC_AH) {
ah = (ipsec_ah_t *) (buf + sizeof(struct iphdr));
Expand Down

0 comments on commit 531f2e7

Please sign in to comment.