[PATCH] missing handling of netdevice events in IPv6 neighbour discovery

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



During testing of VLAN I came across some problems concerning reference counts on
netdevices. If you try to remove a VLAN device with vconfig rem it can happen that the
session hangs for up to 30 seconds and waits for references (unregister_netdev waits)
on the netdevice that is to be unregistered. These references are hold by routing entries
as part of IPv6 neighbour discovery.
The same problem occurs if a device driver wants to unregister a netdevice.

The problem is that ndisc does not handle the NETDEVICE_DOWN and
NETDEVICE_UNREGISTER events. As a result, routing entries related to the removed
device are not deleted immediately. Instead they are freed in a deferred way by the
garbage collector (fib6_gc_run).
I tested on s390x, but the problem should not be arch-specify. The patch against 2.6.4
below adds the missing event handling to ndisc.

-- 
Regards,
Thomas.

--- linux-2.6.4/net/ipv6/ndisc.c	2004-03-11 03:55:33.000000000 +0100
+++ linux-2.6.4-ndisc/net/ipv6/ndisc.c	2004-04-01 15:56:28.000000000 +0200
@@ -1403,6 +1403,13 @@
 		neigh_changeaddr(&nd_tbl, dev);
 		fib6_run_gc(0);
 		break;
+	case NETDEV_DOWN:
+		neigh_ifdown(&nd_tbl, dev);
+		fib6_run_gc(0);
+		break;
+	case NETDEV_UNREGISTER:
+		fib6_run_gc(0);
+		break;
 	default:
 		break;
 	}

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux