Commit 7cd04fa7 authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller

[TCP]: Merge exit paths in tcp_v4_conn_request.

Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f0fd56ed
...@@ -1355,8 +1355,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) ...@@ -1355,8 +1355,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
(s32)(peer->tcp_ts - req->ts_recent) > (s32)(peer->tcp_ts - req->ts_recent) >
TCP_PAWS_WINDOW) { TCP_PAWS_WINDOW) {
NET_INC_STATS_BH(LINUX_MIB_PAWSPASSIVEREJECTED); NET_INC_STATS_BH(LINUX_MIB_PAWSPASSIVEREJECTED);
dst_release(dst); goto drop_and_release;
goto drop_and_free;
} }
} }
/* Kill the following clause, if you dislike this way. */ /* Kill the following clause, if you dislike this way. */
...@@ -1376,24 +1375,21 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) ...@@ -1376,24 +1375,21 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
"request from %u.%u.%u.%u/%u\n", "request from %u.%u.%u.%u/%u\n",
NIPQUAD(saddr), NIPQUAD(saddr),
ntohs(tcp_hdr(skb)->source)); ntohs(tcp_hdr(skb)->source));
dst_release(dst); goto drop_and_release;
goto drop_and_free;
} }
isn = tcp_v4_init_sequence(skb); isn = tcp_v4_init_sequence(skb);
} }
tcp_rsk(req)->snt_isn = isn; tcp_rsk(req)->snt_isn = isn;
if (__tcp_v4_send_synack(sk, req, dst)) if (__tcp_v4_send_synack(sk, req, dst) || want_cookie)
goto drop_and_free; goto drop_and_free;
if (want_cookie) { inet_csk_reqsk_queue_hash_add(sk, req, TCP_TIMEOUT_INIT);
reqsk_free(req);
} else {
inet_csk_reqsk_queue_hash_add(sk, req, TCP_TIMEOUT_INIT);
}
return 0; return 0;
drop_and_release:
dst_release(dst);
drop_and_free: drop_and_free:
reqsk_free(req); reqsk_free(req);
drop: drop:
......
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