netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, "Denis V. Lunev" <den@openvz.org>
Subject: [PATCH 4/4 net-2.6.26] [TCP]: Merge exit paths in tcp_v4_conn_request.
Date: Mon,  3 Mar 2008 18:48:43 +0300	[thread overview]
Message-ID: <1204559323-19953-4-git-send-email-den@openvz.org> (raw)
In-Reply-To: <1204559323-19953-1-git-send-email-den@openvz.org>

Signed-off-by: Denis V. Lunev <den@openvz.org>
---
 net/ipv4/tcp_ipv4.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 3b26f95..3873c4d 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)
 			    (s32)(peer->tcp_ts - req->ts_recent) >
 							TCP_PAWS_WINDOW) {
 				NET_INC_STATS_BH(LINUX_MIB_PAWSPASSIVEREJECTED);
-				dst_release(dst);
-				goto drop_and_free;
+				goto drop_and_release;
 			}
 		}
 		/* 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)
 				       "request from %u.%u.%u.%u/%u\n",
 				       NIPQUAD(saddr),
 				       ntohs(tcp_hdr(skb)->source));
-			dst_release(dst);
-			goto drop_and_free;
+			goto drop_and_release;
 		}
 
 		isn = tcp_v4_init_sequence(skb);
 	}
 	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;
 
-	if (want_cookie) {
-		reqsk_free(req);
-	} else {
-		inet_csk_reqsk_queue_hash_add(sk, req, TCP_TIMEOUT_INIT);
-	}
+	inet_csk_reqsk_queue_hash_add(sk, req, TCP_TIMEOUT_INIT);
 	return 0;
 
+drop_and_release:
+	dst_release(dst);
 drop_and_free:
 	reqsk_free(req);
 drop:
-- 
1.5.3.rc5


  parent reply	other threads:[~2008-03-03 15:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-03 15:48 [PATCH 1/4 net-2.6.26] [IPV4]: skb->dst can't be NULL in ip_options_echo Denis V. Lunev
2008-03-03 15:48 ` [PATCH 2/4 net-2.6.26] [IPV4]: Cleanup ip_options_compile Denis V. Lunev
2008-03-03 19:55   ` David Miller
2008-03-03 20:54     ` Denis V. Lunev
2008-03-03 21:24       ` David Miller
2008-03-03 22:57         ` Denis V. Lunev
2008-03-03 23:02           ` David Miller
2008-03-03 15:48 ` [PATCH 3/4 net-2.6.26] [SCTP]: seq_printf format warning Denis V. Lunev
2008-03-03 17:39   ` YOSHIFUJI Hideaki / 吉藤英明
2008-03-03 17:53     ` [PATCH 3/4 net-2.6.26] [SCTP]: seq_printf format warning. (fixed) Denis V. Lunev
2008-03-03 19:56       ` David Miller
2008-03-03 18:41     ` [PATCH 3/4 net-2.6.26] [SCTP]: seq_printf format warning Vlad Yasevich
2008-03-03 15:48 ` Denis V. Lunev [this message]
2008-03-03 19:59   ` [PATCH 4/4 net-2.6.26] [TCP]: Merge exit paths in tcp_v4_conn_request David Miller
2008-03-03 19:50 ` [PATCH 1/4 net-2.6.26] [IPV4]: skb->dst can't be NULL in ip_options_echo David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1204559323-19953-4-git-send-email-den@openvz.org \
    --to=den@openvz.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).