Brian Pomerantz wrote: > 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. > > @@ -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; > + } > } > } You assume all addresses following the primary addresses are secondary addresses of the primary, which is not true with multiple primaries. This patch (untested) makes sure only to send notification for real secondaries of the deleted address. It also removes a racy double- check for IN_DEV_PROMOTE_SECONDARIES - once we've decided to promote an address checking again opens a window in which address promotion could be disabled and we end up with only secondaries without a primary address. Signed-off-by: Patrick McHardy