Date: Mon, 22 Jun 2020 14:01:31 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362497 - head/sys/netinet Message-ID: <202006221401.05ME1Vi8057677@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Mon Jun 22 14:01:31 2020 New Revision: 362497 URL: https://svnweb.freebsd.org/changeset/base/362497 Log: Move the definition of SCTP's system_base_info into sctp_crc32.c. This file is the only SCTP source file compiled into the kernel when SCTP_SUPPORT is configured. sctp_delayed_checksum() references a couple of counters defined in system_base_info, so the change allows these counters to be referenced in a kernel compiled without "options SCTP". Submitted by: tuexen MFC with: r362338 Modified: head/sys/netinet/sctp_crc32.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_crc32.c ============================================================================== --- head/sys/netinet/sctp_crc32.c Mon Jun 22 12:36:05 2020 (r362496) +++ head/sys/netinet/sctp_crc32.c Mon Jun 22 14:01:31 2020 (r362497) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include <netinet/sctp.h> #include <netinet/sctp_crc32.h> -#ifdef SCTP +#if defined(SCTP) || defined(SCTP_SUPPORT) #include <netinet/sctp_os.h> #include <netinet/sctp_crc32.h> #include <netinet/sctp_pcb.h> @@ -117,6 +117,9 @@ sctp_calculate_cksum(struct mbuf *m, uint32_t offset) } #if defined(SCTP) || defined(SCTP_SUPPORT) + +VNET_DEFINE(struct sctp_base_info, system_base_info); + /* * Compute and insert the SCTP checksum in network byte order for a given * mbuf chain m which contains an SCTP packet starting at offset. @@ -127,10 +130,8 @@ sctp_delayed_cksum(struct mbuf *m, uint32_t offset) uint32_t checksum; checksum = sctp_calculate_cksum(m, offset); -#ifdef SCTP SCTP_STAT_DECR(sctps_sendhwcrc); SCTP_STAT_INCR(sctps_sendswcrc); -#endif offset += offsetof(struct sctphdr, checksum); if (offset + sizeof(uint32_t) > (uint32_t)(m->m_pkthdr.len)) { Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Jun 22 12:36:05 2020 (r362496) +++ head/sys/netinet/sctp_pcb.c Mon Jun 22 14:01:31 2020 (r362497) @@ -57,8 +57,6 @@ __FBSDID("$FreeBSD$"); #include <sys/smp.h> #include <sys/unistd.h> -VNET_DEFINE(struct sctp_base_info, system_base_info); - /* FIX: we don't handle multiple link local scopes */ /* "scopeless" replacement IN6_ARE_ADDR_EQUAL */ #ifdef INET6
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006221401.05ME1Vi8057677>