sbappendcontrol() was improperly setting sb_lastmbuf, creating a possible
commitadd61fba5e7e14c45a47f6a730c160d76a851ba5
authorMatthew Dillon <dillon@dragonflybsd.org>
Sun, 22 Apr 2007 04:08:59 +0000 (22 04:08 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sun, 22 Apr 2007 04:08:59 +0000 (22 04:08 +0000)
treec01d75ba8538fc5606cc2ad59fc82dcb1f824bdb
parent98630820ba922290d14e9981af0e0b9ecf1426ae
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