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-03 18:05:43 +00:00
2016-05-03 18:05:43 +00:00
2016-05-03 18:05:43 +00:00
2016-05-03 18:05:43 +00:00
2016-03-31 00:53:23 +00:00
2015-12-17 14:41:30 +00:00
2015-07-31 09:02:28 +00:00
2016-05-03 18:05:43 +00:00
2016-04-14 18:57:30 +00:00
2016-05-03 18:05:43 +00:00
2016-01-22 18:22:03 +00:00
2016-05-03 18:05:43 +00:00
2016-04-18 06:38:53 +00:00
2015-06-17 15:20:14 +00:00
2016-05-09 16:35:05 +00:00
2016-04-16 21:34:49 +00:00
2016-04-09 10:58:08 +00:00
2016-05-03 18:05:43 +00:00