tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: question about mbuf intialization

On 27/09/2013 12:41 AM, Christos Zoulas wrote:
I've been looking at the code and it seems to me that not only m_get() needs to be changed, but also m_getcl() and MCLGET(). In essence, none of the allocators currently set m_len or m_pkthdr.len, and they leave it to the packet formation routines to do so. I am not against setting the length to 0 by default on construction to make things more robust (I don't think it makes any performance difference these days); I am just mentioning that if we do that we should fix it consistently (if anyone can call the mbuf API consistent...) christos

The correct argument to me would appear to be that since the mbufs
contain no data in them when returned by m_get() that the length
fields should read as "0" in order to reflect that (if they don't already.)


Home | Main Index | Thread Index | Old Index