From 14deae41566b5cdd992c01d0069518ced5227c83 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 4 Jan 2009 16:04:39 -0800 Subject: ipv6: Fix sporadic sendmsg -EINVAL when sending to multicast groups. Thanks to excellent diagnosis by Eduard Guzovsky. The core problem is that on a network with lots of active multicast traffic, the neighbour cache can fill up. If we try to allocate a new route and thus neighbour cache entry, the bog-standard GC attempt the neighbour layer does in ineffective because route entries hold a reference to the existing neighbour entries and GC can only liberate entries with no references. IPV4 already has a way to handle this, by doing a route cache GC in such situations (when neigh attach returns -ENOBUFS). So simply mimick this on the ipv6 side. Tested-by: Eduard Guzovsky Signed-off-by: David S. Miller --- include/net/ndisc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/net/ndisc.h') diff --git a/include/net/ndisc.h b/include/net/ndisc.h index ce532f2222c..1459ed3e269 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h @@ -155,9 +155,9 @@ static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const s { if (dev) - return __neigh_lookup(&nd_tbl, addr, dev, 1); + return __neigh_lookup_errno(&nd_tbl, addr, dev); - return NULL; + return ERR_PTR(-ENODEV); } -- cgit v1.2.3-70-g09d2