net: use sk_fullsock() in __netdev_pick_tx()
authorEric Dumazet <edumazet@google.com>
Mon, 5 Oct 2015 04:08:10 +0000 (21:08 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Oct 2015 09:45:25 +0000 (02:45 -0700)
SYN_RECV & TIMEWAIT sockets are not full blown, they do not have a
sk_dst_cache pointer.

Fixes: ca6fb0651883 ("tcp: attach SYNACK messages to request sockets instead of listener")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/request_sock.h
net/core/dev.c

index dd423d84085247bd71e14c217876eeb653ac7a73..f83669460d82429e36d2bb4f74366092123c0162 100644 (file)
@@ -92,6 +92,7 @@ reqsk_alloc(const struct request_sock_ops *ops, struct sock *sk_listener)
                req->rsk_listener = sk_listener;
                req_to_sk(req)->sk_prot = sk_listener->sk_prot;
                sk_node_init(&req_to_sk(req)->sk_node);
+               sk_tx_queue_clear(req_to_sk(req));
                req->saved_syn = NULL;
                /* Following is temporary. It is coupled with debugging
                 * helpers in reqsk_put() & reqsk_free()
index 323c04edd779af156c19538aa9cee649dc039811..a229bf0d649dc9bf58ece00e95d58f8a133addca 100644 (file)
@@ -2974,6 +2974,7 @@ static u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb)
                        new_index = skb_tx_hash(dev, skb);
 
                if (queue_index != new_index && sk &&
+                   sk_fullsock(sk) &&
                    rcu_access_pointer(sk->sk_dst_cache))
                        sk_tx_queue_set(sk, new_index);