svn commit: r275826 - stable/9/sys/netipsec

Andrey V. Elsukov ae at FreeBSD.org
Tue Dec 16 11:49:36 UTC 2014


Author: ae
Date: Tue Dec 16 11:49:35 2014
New Revision: 275826
URL: https://svnweb.freebsd.org/changeset/base/275826

Log:
  MFC r275393:
    Remove unneded check. No need to do m_pullup to the size that we prepended.
  
  MFC r275473:
    Fix style(9) and remove m_freem(NULL).
    Add XXX comment, it looks incorrect, because m_pkthdr.len is already
    incremented by M_PREPEND().
  
  Sponsored by:	Yandex LLC

Modified:
  stable/9/sys/netipsec/keysock.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netipsec/keysock.c
==============================================================================
--- stable/9/sys/netipsec/keysock.c	Tue Dec 16 11:45:33 2014	(r275825)
+++ stable/9/sys/netipsec/keysock.c	Tue Dec 16 11:49:35 2014	(r275826)
@@ -144,14 +144,11 @@ key_sendup0(rp, m, promisc)
 		struct sadb_msg *pmsg;
 
 		M_PREPEND(m, sizeof(struct sadb_msg), M_DONTWAIT);
-		if (m && m->m_len < sizeof(struct sadb_msg))
-			m = m_pullup(m, sizeof(struct sadb_msg));
-		if (!m) {
+		if (m == NULL) {
 			PFKEYSTAT_INC(in_nomem);
-			m_freem(m);
-			return ENOBUFS;
+			return (ENOBUFS);
 		}
-		m->m_pkthdr.len += sizeof(*pmsg);
+		m->m_pkthdr.len += sizeof(*pmsg); /* XXX: is this correct? */
 
 		pmsg = mtod(m, struct sadb_msg *);
 		bzero(pmsg, sizeof(*pmsg));


More information about the svn-src-stable-9 mailing list