sbappendcontrol() was improperly setting sb_lastmbuf, creating a possible
authorMatthew Dillon <dillon@dragonflybsd.org>
Sun, 22 Apr 2007 04:08:59 +0000 (04:08 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sun, 22 Apr 2007 04:08:59 +0000 (04:08 +0000)
commit64dfff29f668849c6f48cdf8d280c538d7a2b44d
tree3d3d46fc0640dfb8666eaaae69b85e6ee0d08dbb
parent29416812334646999b64441c359ebaacfbaf4149
sbappendcontrol() was improperly setting sb_lastmbuf, creating a possible
mbuf leak and/or sb_cc count mismatch.  The passed mbuf 'm' is a chain,
not a single mbuf, and must be iterated through to locate the last mbuf.

Optimize sbappend().  M_EOR is always set in the last mbuf and the sockbuf's
sb_lastmbuf and sb_lastrecord fields can be used instead of iterating
through all the mbufs in the sockbuf.  Only UNIX domain stream sockets used
this function.  Normal TCP connections use the already-optimized
sbappendstream() call.

Properly propogate M_EOR in sbappendcontrol() and sbappendaddr().

Do various code and comment cleanups.
sys/kern/uipc_sockbuf.c