diff options
author | andre <andre@FreeBSD.org> | 2007-03-23 18:33:21 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2007-03-23 18:33:21 +0000 |
commit | 8057f896948e710b7ef3c79a9ff199364c0ae084 (patch) | |
tree | 0ddae26d2fdc1f3b0685d969c22daa231415b91a /sys/netinet/tcp_reass.c | |
parent | 55f67dd8da67ce2dfbeef5af920c854ef0469b87 (diff) | |
download | FreeBSD-src-8057f896948e710b7ef3c79a9ff199364c0ae084.zip FreeBSD-src-8057f896948e710b7ef3c79a9ff199364c0ae084.tar.gz |
Bring SACK option handling in tcp_dooptions() in line with all other
options and ajust users accordingly.
Diffstat (limited to 'sys/netinet/tcp_reass.c')
-rw-r--r-- | sys/netinet/tcp_reass.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 29a320f..4c2a490 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -1046,7 +1046,7 @@ after_listen: if (to.to_flags & TOF_MSS) tcp_mss(tp, to.to_mss); if (tp->sack_enable) { - if (!(to.to_flags & TOF_SACK)) + if (!(to.to_flags & TOF_SACKPERM)) tp->sack_enable = 0; else tp->t_flags |= TF_SACK_PERMIT; @@ -1098,7 +1098,8 @@ after_listen: ((!tcp_do_newreno && !tp->sack_enable && tp->t_dupacks < tcprexmtthresh) || ((tcp_do_newreno || tp->sack_enable) && - !IN_FASTRECOVERY(tp) && to.to_nsacks == 0 && + !IN_FASTRECOVERY(tp) && + (to.to_flags & TOF_SACK) == 0 && TAILQ_EMPTY(&tp->snd_holes)))) { KASSERT(headlocked, ("headlocked")); INP_INFO_WUNLOCK(&tcbinfo); @@ -1848,7 +1849,8 @@ after_listen: goto dropafterack; } if (tp->sack_enable && - (to.to_nsacks > 0 || !TAILQ_EMPTY(&tp->snd_holes))) + ((to.to_flags & TOF_SACK) || + !TAILQ_EMPTY(&tp->snd_holes))) tcp_sack_doack(tp, &to, th->th_ack); if (SEQ_LEQ(th->th_ack, tp->snd_una)) { if (tlen == 0 && tiwin == tp->snd_wnd) { @@ -2657,11 +2659,12 @@ tcp_dooptions(struct tcpopt *to, u_char *cp, int cnt, int flags) continue; if (!tcp_do_sack) continue; - to->to_flags |= TOF_SACK; + to->to_flags |= TOF_SACKPERM; break; case TCPOPT_SACK: if (optlen <= 2 || (optlen - 2) % TCPOLEN_SACK != 0) continue; + to->to_flags |= TOF_SACK; to->to_nsacks = (optlen - 2) / TCPOLEN_SACK; to->to_sacks = cp + 2; tcpstat.tcps_sack_rcv_blocks++; |