Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Dec 2014 01:03:22 +0300
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        "Andrey V. Elsukov" <ae@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r275393 - head/sys/netipsec
Message-ID:  <20141203220322.GS47144@FreeBSD.org>
In-Reply-To: <201412020528.sB25SfxW096682@svn.freebsd.org>
References:  <201412020528.sB25SfxW096682@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Dec 02, 2014 at 05:28:41AM +0000, Andrey V. Elsukov wrote:
A> Author: ae
A> Date: Tue Dec  2 05:28:40 2014
A> New Revision: 275393
A> URL: https://svnweb.freebsd.org/changeset/base/275393
A> 
A> Log:
A>   Remove unneded check. No need to do m_pullup to the size that we prepended.
A>   
A>   Sponsored by:	Yandex LLC
A> 
A> Modified:
A>   head/sys/netipsec/keysock.c
A> 
A> Modified: head/sys/netipsec/keysock.c
A> ==============================================================================
A> --- head/sys/netipsec/keysock.c	Tue Dec  2 04:20:50 2014	(r275392)
A> +++ head/sys/netipsec/keysock.c	Tue Dec  2 05:28:40 2014	(r275393)
A> @@ -148,8 +148,6 @@ key_sendup0(rp, m, promisc)
A>  		struct sadb_msg *pmsg;
A>  
A>  		M_PREPEND(m, sizeof(struct sadb_msg), M_NOWAIT);
A> -		if (m && m->m_len < sizeof(struct sadb_msg))
A> -			m = m_pullup(m, sizeof(struct sadb_msg));
A>  		if (!m) {
A>  			PFKEYSTAT_INC(in_nomem);
A>  			m_freem(m);
A> 

- Substitute M_PREPEND with m_prepend()
- style: if (m == NULL)
- Don't call m_freem(NULL)

:)

-- 
Totus tuus, Glebius.



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