Some reassembly code improvements:
- Coalesce 0-byte segments.
- KASSERT that the TCP stack isn't trying to add an old segment, and that our reassembly queue doesn't start with an old segment.
- Belt-and-suspenders: make sure there is no possible way that we can add the stack variable anywhere but the head of the queue. (Its too dangerous to not be paranoid in this area.)
The impetus for this was a bug found in a TCP stack during development testing. The bug caused the TCP stack to add a stale segment to the queue, and also to add a bunch of duplicate 0-byte segments. Eventually, it added the stack entry, which caused a panic.