inet: ip early demux should avoid request sockets
authorEric Dumazet <edumazet@google.com>
Mon, 16 Mar 2015 04:12:13 +0000 (21:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Mar 2015 19:55:29 +0000 (15:55 -0400)
When a request socket is created, we do not cache ip route
dst entry, like for timewait sockets.

Let's use sk_fullsock() helper.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c

index 1f514a0c5e60f688b6cc83520781bb476d96ed92..80067d5858b4adf6d56926989139add1fe217684 100644 (file)
@@ -1518,7 +1518,7 @@ void tcp_v4_early_demux(struct sk_buff *skb)
        if (sk) {
                skb->sk = sk;
                skb->destructor = sock_edemux;
-               if (sk->sk_state != TCP_TIME_WAIT) {
+               if (sk_fullsock(sk)) {
                        struct dst_entry *dst = sk->sk_rx_dst;
 
                        if (dst)
index d89f028dc8c4ca924d5cb02f1223f5369ecc01f2..e4761b22307b2543e004da4027a5ebd8bc13668b 100644 (file)
@@ -1583,7 +1583,7 @@ static void tcp_v6_early_demux(struct sk_buff *skb)
        if (sk) {
                skb->sk = sk;
                skb->destructor = sock_edemux;
-               if (sk->sk_state != TCP_TIME_WAIT) {
+               if (sk_fullsock(sk)) {
                        struct dst_entry *dst = sk->sk_rx_dst;
 
                        if (dst)