From 3533f36552022984c3d7defd3c059d3e20a75b0f Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 15 Jan 2010 17:57:55 -0800 Subject: [PATCH] kernel - fix sctp build (LINT) * malloc_init() needs a pre-initialized ks_magic * Remove unused variables. Reported-by: Peter Avalos --- sys/netinet/sctp_pcb.c | 6 ++++-- sys/netinet/sctputil.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 5583efb620..bca9e666a8 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -4069,8 +4069,9 @@ sctp_del_local_addr_assoc_sa(struct sctp_tcb *stcb, struct sockaddr *sa) static char sctp_pcb_initialized = 0; -#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__DragonFly__) +#if defined(__FreeBSD__) || defined(__APPLE__) /* sysctl */ +/* not used by DragonFly SCTP_ZONE_INIT macro */ static int sctp_max_number_of_assoc = SCTP_MAX_NUM_OF_ASOC; static int sctp_scale_up_for_address = SCTP_SCALE_FOR_ADDR; @@ -4094,7 +4095,8 @@ sctp_pcb_init(void) int i; int hashtblsize = SCTP_TCBHASHSIZE; -#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__DragonFly__) +#if defined(__FreeBSD__) || defined(__APPLE__) + /* not used by DragonFly SCTP_ZONE_INIT macro */ int sctp_chunkscale = SCTP_CHUNKQUEUE_SCALE; #endif diff --git a/sys/netinet/sctputil.h b/sys/netinet/sctputil.h index 85b7749ca5..85c0d9ec38 100644 --- a/sys/netinet/sctputil.h +++ b/sys/netinet/sctputil.h @@ -87,6 +87,7 @@ struct mbuf *sctp_m_copym(struct mbuf *m, int off, int len, int wait); do { \ zone.ks_shortdesc = name; \ zone.ks_size = size; \ + zone.ks_magic = M_MAGIC; \ malloc_init(&zone); \ } while(0) #endif -- 2.11.4.GIT