netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: don't use tw net when accounting for recycled tw
@ 2009-02-26 11:31 Pavel Emelyanov
  2009-02-26 11:35 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Emelyanov @ 2009-02-26 11:31 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List

We already have a valid net in that place, but this is not just a
cleanup - the tw pointer can be NULL there sometimes, thus causing
an oops in NET_NS=y case.

The same place in ipv4 code already works correctly using existing 
net, rather than tw's one.

The bug exists since 2.6.27.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
index 8fe267f..1bcc343 100644
--- a/net/ipv6/inet6_hashtables.c
+++ b/net/ipv6/inet6_hashtables.c
@@ -258,11 +258,11 @@ unique:
 
 	if (twp != NULL) {
 		*twp = tw;
-		NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_TIMEWAITRECYCLED);
+		NET_INC_STATS_BH(net, LINUX_MIB_TIMEWAITRECYCLED);
 	} else if (tw != NULL) {
 		/* Silly. Should hash-dance instead... */
 		inet_twsk_deschedule(tw, death_row);
-		NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_TIMEWAITRECYCLED);
+		NET_INC_STATS_BH(net, LINUX_MIB_TIMEWAITRECYCLED);
 
 		inet_twsk_put(tw);
 	}

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

* Re: [PATCH] ipv6: don't use tw net when accounting for recycled tw
  2009-02-26 11:31 [PATCH] ipv6: don't use tw net when accounting for recycled tw Pavel Emelyanov
@ 2009-02-26 11:35 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-02-26 11:35 UTC (permalink / raw)
  To: xemul; +Cc: netdev

From: Pavel Emelyanov <xemul@openvz.org>
Date: Thu, 26 Feb 2009 14:31:55 +0300

> We already have a valid net in that place, but this is not just a
> cleanup - the tw pointer can be NULL there sometimes, thus causing
> an oops in NET_NS=y case.
> 
> The same place in ipv4 code already works correctly using existing 
> net, rather than tw's one.
> 
> The bug exists since 2.6.27.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Applied and queued up for -stable, thanks!

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

end of thread, other threads:[~2009-02-26 11:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-26 11:31 [PATCH] ipv6: don't use tw net when accounting for recycled tw Pavel Emelyanov
2009-02-26 11:35 ` David Miller

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).