John Baldwin 052a5418e8 Don't reuse the source mbuf in tcp_respond() if it is not writable.
Not all mbufs passed up from device drivers are M_WRITABLE().  In
particular, the Chelsio T4/T5 driver uses a feature called "buffer packing"
to receive multiple frames in a single receive buffer.  The mbufs for
these frames all share the same external storage so are treated as
read-only by the rest of the stack when multiple frames are in flight.
Previously tcp_respond() would blindly overwrite read-only mbufs when
INVARIANTS was disabled or panic with an assertion failure if INVARIANTS
was enabled.  Note that the new case is a bit of a mix of the two other
cases in tcp_respond().  The TCP and IP headers must be copied explicitly
into the new mbuf instead of being inherited (similar to the m == NULL
case), but the addresses and ports must be swapped in the reply (similar
to the m != NULL case).

Reviewed by:	glebius
2016-05-26 18:35:37 +00:00
..
2016-05-25 01:37:39 +00:00
2016-05-20 03:22:41 +00:00
2016-05-03 21:51:52 +00:00
2016-05-26 08:41:55 +00:00
2016-05-10 20:14:11 +00:00
2016-05-23 13:59:48 +00:00
2016-05-03 18:05:43 +00:00
2016-04-29 16:07:25 +00:00
2016-05-26 08:41:55 +00:00
2016-05-17 12:52:31 +00:00