@@ -0,0 +1,39 @@
1+From d80c171e7e8fe7fb4e0878a15027ac80c23b0a14 Mon Sep 17 00:00:00 2001
2+From: David Stapleton <dstaplet@brocade.com>
3+Date: Mon, 15 Jun 2015 13:07:21 +0100
4+Subject: [PATCH] Fix vrrp removes incorrect IPv4 address when VIPs are removed
5+
6+When vrrp has an IPv4 VIP that matches the primary interface
7+address, when the VIP is removed from the interface, the original
8+address ends up getting removed instead of the VIP.
9+
10+The kernel receives a netlink message instructing it to remove
11+address x from a particular interface. For IPv4, address x can
12+be configured multiple times providing the prefix lengths differ.
13+If the IFA_ADDRESS attribute is not specified in a RTM_DELADDR
14+message, the kernel will delete the first address it finds a
15+match on, prefix length is not taken into account.
16+
17+This fix therefore adds the IFA_ADDRESS attribute when deleting
18+IPv4 addresses so that the address removed is actually the VIP.
19+---
20+ keepalived/vrrp/vrrp_ipaddress.c | 3 +++
21+ 1 file changed, 3 insertions(+)
22+
23+diff --git a/keepalived/vrrp/vrrp_ipaddress.c b/keepalived/vrrp/vrrp_ipaddress.c
24+index 0f9ce23..698f35c 100644
25+--- a/keepalived/vrrp/vrrp_ipaddress.c
26++++ b/keepalived/vrrp/vrrp_ipaddress.c
27+@@ -86,6 +86,9 @@ netlink_ipaddress(ip_address_t *ipaddress, int cmd)
28+ } else {
29+ addattr_l(&req.n, sizeof(req), IFA_LOCAL,
30+ &ipaddress->u.sin.sin_addr, sizeof(ipaddress->u.sin.sin_addr));
31++ if (cmd == IPADDRESS_DEL)
32++ addattr_l(&req.n, sizeof(req), IFA_ADDRESS,
33++ &ipaddress->u.sin.sin_addr, sizeof(ipaddress->u.sin.sin_addr));
34+ if (ipaddress->u.sin.sin_brd.s_addr)
35+ addattr_l(&req.n, sizeof(req), IFA_BROADCAST,
36+ &ipaddress->u.sin.sin_brd, sizeof(ipaddress->u.sin.sin_brd));
37+--
38+2.4.4
39+