aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-03-03 14:59:32 -0500
committerDavid S. Miller <davem@davemloft.net>2008-03-03 14:59:32 -0500
commit7cd04fa7e35100877592f6be4efdccac0fed62b2 (patch)
treea04b65b481acae9800dcbc4e422142b13c07f5f9
parentf0fd56ed40ec5fb889bfc7efccd1c5759e6e9937 (diff)
[TCP]: Merge exit paths in tcp_v4_conn_request.
Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/tcp_ipv4.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 3b26f9586dcb..3873c4dbeaeb 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1355,8 +1355,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
1355 (s32)(peer->tcp_ts - req->ts_recent) > 1355 (s32)(peer->tcp_ts - req->ts_recent) >
1356 TCP_PAWS_WINDOW) { 1356 TCP_PAWS_WINDOW) {
1357 NET_INC_STATS_BH(LINUX_MIB_PAWSPASSIVEREJECTED); 1357 NET_INC_STATS_BH(LINUX_MIB_PAWSPASSIVEREJECTED);
1358 dst_release(dst); 1358 goto drop_and_release;
1359 goto drop_and_free;
1360 } 1359 }
1361 } 1360 }
1362 /* Kill the following clause, if you dislike this way. */ 1361 /* 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 "request from %u.%u.%u.%u/%u\n", 1375 "request from %u.%u.%u.%u/%u\n",
1377 NIPQUAD(saddr), 1376 NIPQUAD(saddr),
1378 ntohs(tcp_hdr(skb)->source)); 1377 ntohs(tcp_hdr(skb)->source));
1379 dst_release(dst); 1378 goto drop_and_release;
1380 goto drop_and_free;
1381 } 1379 }
1382 1380
1383 isn = tcp_v4_init_sequence(skb); 1381 isn = tcp_v4_init_sequence(skb);
1384 } 1382 }
1385 tcp_rsk(req)->snt_isn = isn; 1383 tcp_rsk(req)->snt_isn = isn;
1386 1384
1387 if (__tcp_v4_send_synack(sk, req, dst)) 1385 if (__tcp_v4_send_synack(sk, req, dst) || want_cookie)
1388 goto drop_and_free; 1386 goto drop_and_free;
1389 1387
1390 if (want_cookie) { 1388 inet_csk_reqsk_queue_hash_add(sk, req, TCP_TIMEOUT_INIT);
1391 reqsk_free(req);
1392 } else {
1393 inet_csk_reqsk_queue_hash_add(sk, req, TCP_TIMEOUT_INIT);
1394 }
1395 return 0; 1389 return 0;
1396 1390
1391drop_and_release:
1392 dst_release(dst);
1397drop_and_free: 1393drop_and_free:
1398 reqsk_free(req); 1394 reqsk_free(req);
1399drop: 1395drop: