Patrick McHardy wrote:
jamal wrote:
Dave,
This is a bug fix. So not sure if it is fitting for 2.6.15 or not.
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 4ec4b2c..495bf22 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -283,18 +289,32 @@ static void inet_del_ifa(struct in_devic
*/
rtmsg_ifa(RTM_DELADDR, ifa1);
notifier_call_chain(&inetaddr_chain, NETDEV_DOWN, ifa1);
- if (destroy) {
- inet_free_ifa(ifa1);
-
- if (!in_dev->ifa_list)
- inetdev_destroy(in_dev);
- }
if (promote && IN_DEV_PROMOTE_SECONDARIES(in_dev)) {
- /* not sure if we should send a delete notify first? */
+
+
+ if (prev_prom) {
+ prev_prom->ifa_next = promote->ifa_next;
+ promote->ifa_next = last_prim->ifa_next;
+ last_prim->ifa_next = promote;
+ }
Are you sure nothing will get confused by having the promoted
address invisible for a short period of time even though its
still used as prefered source? I'm also wondering if an explicit
barrier is needed after changing prev_prom and promote.
Ah, I missed it is still removed before. Please forget about the
first point. Another thing though is that it still has a different
race, IN_DEV_PROMOTE_SECONDARIES can change between the first
and the second check, just checking for promote != NULL is enough
and prevents that race.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html