From: Eric Dumazet Date: Thu, 3 Jun 2010 05:45:47 +0000 (+0000) Subject: tcp: use correct net ns in cookie_v4_check() X-Git-Tag: v2.6.33.7~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1d08ba9d511d0152eaa80c6a460fdbd48926e12;p=thirdparty%2Fkernel%2Fstable.git tcp: use correct net ns in cookie_v4_check() [ Upstream commit c44649216522cd607a4027d2ebf4a8147d3fa94c ] Its better to make a route lookup in appropriate namespace. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c index 66fd80ef24733..214a2f656a5ed 100644 --- a/net/ipv4/syncookies.c +++ b/net/ipv4/syncookies.c @@ -347,7 +347,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, { .sport = th->dest, .dport = th->source } } }; security_req_classify_flow(req, &fl); - if (ip_route_output_key(&init_net, &rt, &fl)) { + if (ip_route_output_key(sock_net(sk), &rt, &fl)) { reqsk_free(req); goto out; }