From 92369d006dd2e4e20fa43e7ea2094f4feb4ca209 Mon Sep 17 00:00:00 2001 From: Julian Anastasov Date: Sat, 19 Mar 2011 12:13:52 +0000 Subject: [PATCH] --- yaml --- r: 242609 b: refs/heads/master c: 2d230e2b2c3111cf4a11619f60dcd158ae84e3ab h: refs/heads/master i: 242607: fc788a4e5489eaedf91ef62dcf8df2382278efac v: v3 --- [refs] | 2 +- trunk/net/ipv4/devinet.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index d356b60d8886..cdf3750039e2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e6abbaa2725a43cf5d26c4c2a5dc6c0f6029ea19 +refs/heads/master: 2d230e2b2c3111cf4a11619f60dcd158ae84e3ab diff --git a/trunk/net/ipv4/devinet.c b/trunk/net/ipv4/devinet.c index 6d85800daeb7..2523001f4c9a 100644 --- a/trunk/net/ipv4/devinet.c +++ b/trunk/net/ipv4/devinet.c @@ -345,6 +345,17 @@ static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, } } + /* On promotion all secondaries from subnet are changing + * the primary IP, we must remove all their routes silently + * and later to add them back with new prefsrc. Do this + * while all addresses are on the device list. + */ + for (ifa = promote; ifa; ifa = ifa->ifa_next) { + if (ifa1->ifa_mask == ifa->ifa_mask && + inet_ifa_match(ifa1->ifa_address, ifa)) + fib_del_ifaddr(ifa, ifa1); + } + /* 2. Unlink it */ *ifap = ifa1->ifa_next;