00db14
From f42914b07166db123b55a4acd31f4a6eb280d0f8 Mon Sep 17 00:00:00 2001
00db14
From: Ryan O'Hara <rohara@redhat.com>
00db14
Date: Mon, 11 Dec 2017 12:36:26 -0600
00db14
Subject: [PATCH] Exclude mixed family VIPs from VRRP advertisements
00db14
00db14
In previous releases of keepalived, it was allowed to have both IPv5
00db14
and IPv6 addresses in the 'virtual_ipaddress' block. The address count
00db14
in VRRP advertisements would reflect all VIPS, both IPv4 and IPv6, but
00db14
the address list would contain empty addresses for any VIP that did
00db14
not match the VRRP instance family. In VRRPv3 this is not allowed, and
00db14
recent releases will simply ignore any VIP that does not match the
00db14
instance family causing those VIPs to not be created in the interface.
00db14
00db14
Rather than ignore the VIP of mismatched family, this patch will move
00db14
non-matching VIP to the excluded list causing them to not be included
00db14
in the VRRP advertisements but still create them when in MASTER state.
00db14
---
00db14
 keepalived/vrrp/vrrp_parser.c | 3 ++-
00db14
 1 file changed, 2 insertions(+), 1 deletion(-)
00db14
00db14
diff --git a/keepalived/vrrp/vrrp_parser.c b/keepalived/vrrp/vrrp_parser.c
00db14
index 7a383153..d2cd720a 100644
00db14
--- a/keepalived/vrrp/vrrp_parser.c
00db14
+++ b/keepalived/vrrp/vrrp_parser.c
00db14
@@ -641,8 +641,9 @@ vrrp_vip_handler(__attribute__((unused)) vector_t *strvec)
00db14
 				if (vrrp->family == AF_UNSPEC)
00db14
 					vrrp->family = address_family;
00db14
 				else if (address_family != vrrp->family) {
00db14
-					log_message(LOG_INFO, "(%s): address family must match VRRP instance [%s] - ignoring", vrrp->iname, str);
00db14
+					log_message(LOG_WARNING, "(%s): address family does not match VRRP instance [%s]", vrrp->iname, str);
00db14
 					free_list_element(vrrp->vip, vrrp->vip->tail);
00db14
+					alloc_vrrp_evip(vec);
00db14
 				}
00db14
 			}
00db14
 
00db14
-- 
00db14
2.14.2
00db14