netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [IPV4] Fix secondary IP addresses after promotion
@ 2005-11-04 18:46 Brian Pomerantz
  2005-11-05  0:34 ` Patrick McHardy
  0 siblings, 1 reply; 14+ messages in thread
From: Brian Pomerantz @ 2005-11-04 18:46 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuznet, pekkas, jmorris, yoshfuji, kaber, linux-kernel

When 3 or more IP addresses in the same subnet exist on a device and the
first one is removed, only the promoted IP address can be reached.  Just
after promotion of the next IP address, this fix spins through any more
IP addresses on the interface and sends a NETDEV_UP notification for
that address.  This repopulates the FIB with the proper route
information.

Signed-off-by: Brian Pomerantz <bapper@piratehaven.org>

---

 net/ipv4/devinet.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

applies-to: 9bbb209cab841f700162a96e158dfa3ecd361f46
489d4e25469c8329451aca3e91c8e1929e6ecf63
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 4ec4b2c..72d6c93 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -235,6 +235,7 @@ static void inet_del_ifa(struct in_devic
 {
 	struct in_ifaddr *promote = NULL;
 	struct in_ifaddr *ifa1 = *ifap;
+	struct in_ifaddr *ifa;
 
 	ASSERT_RTNL();
 
@@ -243,7 +244,6 @@ static void inet_del_ifa(struct in_devic
 	 **/
 
 	if (!(ifa1->ifa_flags & IFA_F_SECONDARY)) {
-		struct in_ifaddr *ifa;
 		struct in_ifaddr **ifap1 = &ifa1->ifa_next;
 
 		while ((ifa = *ifap1) != NULL) {
@@ -294,7 +294,13 @@ static void inet_del_ifa(struct in_devic
 		/* not sure if we should send a delete notify first? */
 		promote->ifa_flags &= ~IFA_F_SECONDARY;
 		rtmsg_ifa(RTM_NEWADDR, promote);
-		notifier_call_chain(&inetaddr_chain, NETDEV_UP, promote);
+
+		/* update fib in the rest of this address list */
+		ifa = promote;
+		while (ifa != NULL) {
+			notifier_call_chain(&inetaddr_chain, NETDEV_UP, ifa);
+			ifa = ifa->ifa_next;
+		}
 	}
 }
 
---
0.99.9.GIT

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-11-16 19:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-04 18:46 [PATCH] [IPV4] Fix secondary IP addresses after promotion Brian Pomerantz
2005-11-05  0:34 ` Patrick McHardy
2005-11-05  0:58   ` Brian Pomerantz
2005-11-05  1:07   ` Thomas Graf
2005-11-05  1:21     ` Patrick McHardy
2005-11-05  4:28       ` Patrick McHardy
2005-11-05 13:46         ` Thomas Graf
2005-11-07 21:50           ` Thomas Graf
2005-11-08 14:11             ` Patrick McHardy
2005-11-09  0:56               ` Thomas Graf
2005-11-11 13:16                 ` Patrick McHardy
2005-11-16 19:21               ` Brian Pomerantz
2005-11-05 18:39     ` Alexey Kuznetsov
2005-11-05 19:06       ` Thomas Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).