Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jan 2015 13:56:26 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276911 - head/sys/netinet
Message-ID:  <201501101356.t0ADuQXk057536@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sat Jan 10 13:56:26 2015
New Revision: 276911
URL: https://svnweb.freebsd.org/changeset/base/276911

Log:
  Retire SCTP_BUF_EXTEND_SIZE. This patch was suggested by
  Robert Watson.

Modified:
  head/sys/netinet/sctp_bsd_addr.c
  head/sys/netinet/sctp_input.c
  head/sys/netinet/sctp_os_bsd.h

Modified: head/sys/netinet/sctp_bsd_addr.c
==============================================================================
--- head/sys/netinet/sctp_bsd_addr.c	Sat Jan 10 10:41:23 2015	(r276910)
+++ head/sys/netinet/sctp_bsd_addr.c	Sat Jan 10 13:56:26 2015	(r276911)
@@ -381,17 +381,7 @@ sctp_get_mbuf_for_msg(unsigned int space
 		return (m);
 	}
 	if (allonebuf) {
-		int siz;
-
-		if (SCTP_BUF_IS_EXTENDED(m)) {
-			siz = SCTP_BUF_EXTEND_SIZE(m);
-		} else {
-			if (want_header)
-				siz = MHLEN;
-			else
-				siz = MLEN;
-		}
-		if (siz < space_needed) {
+		if (SCTP_BUF_SIZE(m) < space_needed) {
 			m_freem(m);
 			return (NULL);
 		}

Modified: head/sys/netinet/sctp_input.c
==============================================================================
--- head/sys/netinet/sctp_input.c	Sat Jan 10 10:41:23 2015	(r276910)
+++ head/sys/netinet/sctp_input.c	Sat Jan 10 13:56:26 2015	(r276911)
@@ -5967,19 +5967,6 @@ out:
 	return;
 }
 
-#if 0
-static void
-sctp_print_mbuf_chain(struct mbuf *m)
-{
-	for (; m; m = SCTP_BUF_NEXT(m)) {
-		SCTP_PRINTF("%p: m_len = %ld\n", (void *)m, SCTP_BUF_LEN(m));
-		if (SCTP_BUF_IS_EXTENDED(m))
-			SCTP_PRINTF("%p: extend_size = %d\n", (void *)m, SCTP_BUF_EXTEND_SIZE(m));
-	}
-}
-
-#endif
-
 #ifdef INET
 void
 sctp_input_with_port(struct mbuf *i_pak, int off, uint16_t port)

Modified: head/sys/netinet/sctp_os_bsd.h
==============================================================================
--- head/sys/netinet/sctp_os_bsd.h	Sat Jan 10 10:41:23 2015	(r276910)
+++ head/sys/netinet/sctp_os_bsd.h	Sat Jan 10 13:56:26 2015	(r276911)
@@ -299,7 +299,7 @@ typedef struct callout sctp_os_timer_t;
 #define SCTP_BUF_RESV_UF(m, size) m->m_data += size
 #define SCTP_BUF_AT(m, size) m->m_data + size
 #define SCTP_BUF_IS_EXTENDED(m) (m->m_flags & M_EXT)
-#define SCTP_BUF_EXTEND_SIZE(m) (m->m_ext.ext_size)
+#define SCTP_BUF_SIZE M_SIZE
 #define SCTP_BUF_TYPE(m) (m->m_type)
 #define SCTP_BUF_RECVIF(m) (m->m_pkthdr.rcvif)
 #define SCTP_BUF_PREPEND	M_PREPEND



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