Author: lstewart
Date: Wed May  1 08:57:45 2013
New Revision: 250141
URL: http://svnweb.freebsd.org/changeset/base/250141

Log:
  MFC r245783:
  
  Simplify and fix a bug in cc_ack_received()'s "are we congestion window 
limited"
  logic (refer to [1] for associated discussion). snd_cwnd and snd_wnd are
  unsigned long and on 64 bit hosts, min() will truncate them to 32 bits and 
could
  therefore potentially corrupt the result (although under normal operation,
  neither variable should legitmately exceed 32 bits).
  
  [1] http://lists.freebsd.org/pipermail/freebsd-net/2013-January/034297.html
  
  Submitted by: jhb

Modified:
  stable/8/sys/netinet/tcp_input.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/netinet/tcp_input.c
==============================================================================
--- stable/8/sys/netinet/tcp_input.c    Wed May  1 08:53:40 2013        
(r250140)
+++ stable/8/sys/netinet/tcp_input.c    Wed May  1 08:57:45 2013        
(r250141)
@@ -269,7 +269,7 @@ cc_ack_received(struct tcpcb *tp, struct
        INP_WLOCK_ASSERT(tp->t_inpcb);
 
        tp->ccv->bytes_this_ack = BYTES_THIS_ACK(tp, th);
-       if (tp->snd_cwnd == min(tp->snd_cwnd, tp->snd_wnd))
+       if (tp->snd_cwnd <= tp->snd_wnd)
                tp->ccv->flags |= CCF_CWND_LIMITED;
        else
                tp->ccv->flags &= ~CCF_CWND_LIMITED;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to