svn commit: r316822 - in head/sys: kern netinet netinet6

Gleb Smirnoff glebius at FreeBSD.org
Fri Apr 14 21:30:12 UTC 2017


  Andrey,

On Fri, Apr 14, 2017 at 09:00:48AM +0000, Andrey V. Elsukov wrote:
A> Log:
A>   Rework r316770 to make it protocol independent and general, like we
A>   do for streaming sockets.
A>   
A>   And do more cleanup in the sbappendaddr_locked_internal() to prevent
A>   leak information from existing mbuf to the one, that will be possible
A>   created later by netgraph.

Thanks!

Your comment actually made me think that this can be improved...

A> @@ -794,8 +794,20 @@ sbappendaddr_locked_internal(struct sock
A>  		return (0);
A>  	m->m_len = asa->sa_len;
A>  	bcopy(asa, mtod(m, caddr_t), asa->sa_len);
A> -	if (m0)
A> +	if (m0) {
A>  		m_clrprotoflags(m0);
A> +		m_tag_delete_chain(m0);
A> +		/*
A> +		 * Clear some persistent info from pkthdr.
A> +		 * We don't use m_demote(), because some netgraph consumers
A> +		 * expect M_PKTHDR presence.
A> +		 */

Looks like you are right and only netgraph wants to see M_PKTHDR there.
Rest of datagram socket consumers just use m_nextpkt to differentiate
records from parts of records.

I'll see if we can fix ng_ksocket and use same code on datagram sockbufs
as we do on stream ones.

-- 
Totus tuus, Glebius.


More information about the svn-src-all mailing list