The message code is horribly broken in three ways.
1. Clearing the message also sets the reference count to zero.
2. The recycling code in msg_put does not test the reference count.
3. The allocation code does not remove the message from the pool,
although this code was never reached because of point 2.
This patch fixes the issues and also adds some debugging code to trace
the message pool statistics.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
This patch is in preparation for handling the suffix TLV data. We will
need to use the structure size more than once.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>