Lines 879-886
tcp_sack_partialack(struct tcpcb *tp, struct tcphdr *th)
Link Here
|
879 |
highdata--; |
879 |
highdata--; |
880 |
if (th->th_ack != highdata) { |
880 |
if (th->th_ack != highdata) { |
881 |
tp->snd_fack = th->th_ack; |
881 |
tp->snd_fack = th->th_ack; |
882 |
(void)tcp_sackhole_insert(tp, SEQ_MAX(th->th_ack, |
882 |
struct socket *so = tp->t_inpcb->inp_socket; |
883 |
highdata - maxseg), highdata, NULL); |
883 |
tcp_seq top = tp->snd_una + sbused(&so->so_snd); |
|
|
884 |
KASSERT(SEQ_LEQ(highdata, top), |
885 |
("%s: rescue.end > so_snd, NEEDFIN:%d SENTFIN:%d\n", |
886 |
__func__, (tp->t_flags & TF_NEEDFIN) != 0, |
887 |
(tp->t_flags & TF_SENTFIN) != 0)); |
888 |
if (SEQ_GT(highdata, top)) { |
889 |
log(LOG_CRIT,"%s#%d: rescue (%u-%u) > so_snd %u skipping.\n", |
890 |
__func__, __LINE__, |
891 |
SEQ_MAX(th->th_ack, highdata - maxseg), |
892 |
highdata, top); |
893 |
} else |
894 |
(void)tcp_sackhole_insert(tp, SEQ_MAX(th->th_ack, |
895 |
highdata - maxseg), highdata, NULL); |
884 |
} |
896 |
} |
885 |
} |
897 |
} |
886 |
(void) tp->t_fb->tfb_tcp_output(tp); |
898 |
(void) tp->t_fb->tfb_tcp_output(tp); |
Lines 937-948
tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt)
Link Here
|
937 |
INP_WLOCK_ASSERT(tp->t_inpcb); |
949 |
INP_WLOCK_ASSERT(tp->t_inpcb); |
938 |
*sack_bytes_rexmt = tp->sackhint.sack_bytes_rexmit; |
950 |
*sack_bytes_rexmt = tp->sackhint.sack_bytes_rexmit; |
939 |
hole = tp->sackhint.nexthole; |
951 |
hole = tp->sackhint.nexthole; |
940 |
if (hole == NULL || SEQ_LT(hole->rxmit, hole->end)) |
952 |
if (hole == NULL) |
941 |
goto out; |
953 |
return (hole); |
942 |
while ((hole = TAILQ_NEXT(hole, scblink)) != NULL) { |
954 |
if (SEQ_GEQ(hole->rxmit, hole->end)) { |
943 |
if (SEQ_LT(hole->rxmit, hole->end)) { |
955 |
for (;;) { |
944 |
tp->sackhint.nexthole = hole; |
956 |
hole = TAILQ_NEXT(hole, scblink); |
945 |
break; |
957 |
if (hole == NULL) |
|
|
958 |
return (hole); |
959 |
if (SEQ_LT(hole->rxmit, hole->end)) { |
960 |
tp->sackhint.nexthole = hole; |
961 |
break; |
962 |
} |
963 |
} |
964 |
} |
965 |
{ |
966 |
struct socket *so = tp->t_inpcb->inp_socket; |
967 |
tcp_seq top = tp->snd_una + sbused(&so->so_snd); |
968 |
KASSERT(SEQ_LT(hole->start, hole->end), ("%s: hole.start >= hole.end", __func__)); |
969 |
KASSERT(SEQ_LEQ(hole->start, top), ("%s: hole.start >= so_snd", __func__)); |
970 |
KASSERT(SEQ_LEQ(hole->end, top), ("%s: hole.end >= so_snd", __func__)); |
971 |
KASSERT(SEQ_LEQ(hole->rxmit, top), ("%s: hole.rxmit >= so_snd", __func__)); |
972 |
if (SEQ_GEQ(hole->start, hole->end) || |
973 |
SEQ_GT(hole->start, top) || |
974 |
SEQ_GT(hole->end, top) || |
975 |
SEQ_GT(hole->rxmit, top)) { |
976 |
log(LOG_CRIT,"%s#%d: invalid SACK hole (%u-%u,%u) vs so_snd %u ignoring.\n", |
977 |
__func__, __LINE__, hole->start, hole->end, hole->rxmit, top); |
978 |
return (NULL); |
946 |
} |
979 |
} |
947 |
} |
980 |
} |
948 |
out: |
981 |
out: |