Sponsored by: Chelsio Communications
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
I tripped over this while doing some internal testing of NIC TLS where I used a hack in tcp_m_copym() that forces truncations in the middle of TLS trailers and I tripped over an assertion that a truncated TLS record can't be transmitted with FIN. Other places in tcp_output() that truncate the length clear TH_FIN as well. Possibly the change to clear tso could also go inside this check, but that would be a larger diff.
I agree with Richard. Something like:
uint32_t old_len; ... old_len = len; m->m_next = tcp_m_copym(mb, moff, &len, if_hw_tsomaxsegcount, if_hw_tsomaxsegsize, msb, hw_tls); if (old_len != len) flags &= ~TH_FIN;
But I leave it up to you.
sys/netinet/tcp_output.c | ||
---|---|---|
1081 | Shall use int32_t, the same type as len. Although we generally think uint32_t is not harmful, but I think we shall stick with the simple rule when comparing int32_t with uint32_t. |
I can fix the type mismatch during commit. I have not looked to see if other stacks are affected.
Fixing the type mismatch would be good. I think other stacks are not affected, since I think they
do not send a FIN before any outstanding data is ACKed and nothing is buffered anymore.