Commit 49c71586 authored by Tonghao Zhang's avatar Tonghao Zhang Committed by David S. Miller

tcp: Get a proper dst before checking it.

tcp_peer_is_proven needs a proper route to make the
determination, but dst always is NULL. This bug may
be there at the beginning of git tree. This does not
look serious enough to deserve backports to stable
versions.
Signed-off-by: default avatarTonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6c647935
...@@ -6111,6 +6111,10 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, ...@@ -6111,6 +6111,10 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
if (tmp_opt.tstamp_ok) if (tmp_opt.tstamp_ok)
tcp_rsk(req)->ts_off = af_ops->init_ts_off(net, skb); tcp_rsk(req)->ts_off = af_ops->init_ts_off(net, skb);
dst = af_ops->route_req(sk, &fl, req);
if (!dst)
goto drop_and_free;
if (!want_cookie && !isn) { if (!want_cookie && !isn) {
/* Kill the following clause, if you dislike this way. */ /* Kill the following clause, if you dislike this way. */
if (!net->ipv4.sysctl_tcp_syncookies && if (!net->ipv4.sysctl_tcp_syncookies &&
...@@ -6131,11 +6135,6 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, ...@@ -6131,11 +6135,6 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
isn = af_ops->init_seq(skb); isn = af_ops->init_seq(skb);
} }
if (!dst) {
dst = af_ops->route_req(sk, &fl, req);
if (!dst)
goto drop_and_free;
}
tcp_ecn_create_request(req, skb, sk, dst); tcp_ecn_create_request(req, skb, sk, dst);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment