Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Apr 2017 14:30:09 -0700
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        "Andrey V. Elsukov" <ae@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r316822 - in head/sys: kern netinet netinet6
Message-ID:  <20170414213009.GI1033@FreeBSD.org>
In-Reply-To: <201704140900.v3E90mJU030549@repo.freebsd.org>
References:  <201704140900.v3E90mJU030549@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
  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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170414213009.GI1033>