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
This commit is contained in:
Mark Johnston 2020-06-22 14:01:31 +00:00
parent 9f763f0092
commit e6db509d10
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=362497
2 changed files with 4 additions and 5 deletions

View File

@ -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)) {

View File

@ -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