lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <alpine.DEB.2.00.0901071009000.6102@rhea>
Date:	Wed, 07 Jan 2009 10:25:16 +0100 (CET)
From:	Arnd Hannemann <hannemann@...s.rwth-aachen.de>
To:	linux-kernel@...r.kernel.org
Cc:	netdev@...r.kernel.org
Subject: [PATCH][TCP]: simplify tcp_mark_lost_retrans()

Hi,

I noticed that in tcp_mark_lost_retrans the for-loop is only entered
if tcp_is_fack(tp) evaluates to true:

           if (!tcp_is_fack(tp) || !tp->retrans_out ||
               !after(received_upto, tp->lost_retrans_low) ||
               icsk->icsk_ca_state != TCP_CA_Recovery)
                   return;

Therefore the following check in the for-loop seems to be redundant,
because it always evaluates to true:

                      (tcp_is_fack(tp) ||
                       !before(received_upto,
                               ack_seq + tp->reordering * tp->mss_cache))

Did I miss something?

Best regards,
Arnd Hannemann

From: Arnd Hannemann <hannemann@...s.rwth-aachen.de>

Because the for loop is only executed for FACK-enabled flows remove
redundant checks within the loop.

Signed-off-by: Arnd Hannemann <hannemann@...s.rwth-aachen.de>
---
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 99b7ecb..cd8b4bd 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1178,10 +1178,7 @@ static void tcp_mark_lost_retrans(struct sock *sk)
    		if (!(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_RETRANS))
    			continue;

-		if (after(received_upto, ack_seq) &&
-		    (tcp_is_fack(tp) ||
-		     !before(received_upto,
-			     ack_seq + tp->reordering * tp->mss_cache))) {
+		if (after(received_upto, ack_seq)) {
    			TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS;
    			tp->retrans_out -= tcp_skb_pcount(skb);

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ