| 6062 | } |
| 6063 | |
| 6064 | static void |
| 6065 | rack_log_output(struct tcpcb *tp, struct tcpopt *to, int32_t len, |
| 6066 | uint32_t seq_out, uint8_t th_flags, int32_t err, uint32_t ts, |
| 6067 | uint8_t pass, struct rack_sendmap *hintrsm, uint32_t us_cts) |
| 6068 | { |
| 6069 | struct tcp_rack *rack; |
| 6070 | struct rack_sendmap *rsm, *nrsm, *insret, fe; |
| 6071 | register uint32_t snd_max, snd_una; |
| 6072 | |
| 6073 | /* |
| 6074 | * Add to the RACK log of packets in flight or retransmitted. If |
| 6075 | * there is a TS option we will use the TS echoed, if not we will |
| 6076 | * grab a TS. |
| 6077 | * |
| 6078 | * Retransmissions will increment the count and move the ts to its |
| 6079 | * proper place. Note that if options do not include TS's then we |
| 6080 | * won't be able to effectively use the ACK for an RTT on a retran. |
| 6081 | * |
| 6082 | * Notes about r_start and r_end. Lets consider a send starting at |
| 6083 | * sequence 1 for 10 bytes. In such an example the r_start would be |
| 6084 | * 1 (starting sequence) but the r_end would be r_start+len i.e. 11. |
| 6085 | * This means that r_end is actually the first sequence for the next |
| 6086 | * slot (11). |
| 6087 | * |
| 6088 | */ |
| 6089 | /* |
| 6090 | * If err is set what do we do XXXrrs? should we not add the thing? |
| 6091 | * -- i.e. return if err != 0 or should we pretend we sent it? -- |
| 6092 | * i.e. proceed with add ** do this for now. |
| 6093 | */ |
| 6094 | INP_WLOCK_ASSERT(tp->t_inpcb); |
| 6095 | if (err) |
| 6096 | /* |
| 6097 | * We don't log errors -- we could but snd_max does not |
| 6098 | * advance in this case either. |
| 6099 | */ |
| 6100 | return; |
| 6101 | |
| 6102 | if (th_flags & TH_RST) { |
| 6103 | /* |
| 6104 | * We don't log resets and we return immediately from |
| 6105 | * sending |
| 6106 | */ |
| 6107 | return; |
| 6108 | } |
| 6109 | rack = (struct tcp_rack *)tp->t_fb_ptr; |
| 6110 | snd_una = tp->snd_una; |
| 6111 | if (SEQ_LEQ((seq_out + len), snd_una)) { |
| 6112 | /* Are sending an old segment to induce an ack (keep-alive)? */ |
| 6113 | return; |
| 6114 | } |
| 6115 | if (SEQ_LT(seq_out, snd_una)) { |
| 6116 | /* huh? should we panic? */ |
| 6117 | uint32_t end; |
| 6118 | |
| 6119 | end = seq_out + len; |
| 6120 | seq_out = snd_una; |
| 6121 | if (SEQ_GEQ(end, seq_out)) |
no test coverage detected