summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/netinet/sctp_bsd_addr.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/netinet/sctp_bsd_addr.c')
-rw-r--r--freebsd/sys/netinet/sctp_bsd_addr.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/freebsd/sys/netinet/sctp_bsd_addr.c b/freebsd/sys/netinet/sctp_bsd_addr.c
index d558bd82..bfd7f816 100644
--- a/freebsd/sys/netinet/sctp_bsd_addr.c
+++ b/freebsd/sys/netinet/sctp_bsd_addr.c
@@ -295,9 +295,12 @@ sctp_addr_change(struct ifaddr *ifa, int cmd)
{
uint32_t ifa_flags = 0;
+ if (SCTP_BASE_VAR(sctp_pcb_initialized) == 0) {
+ return;
+ }
/*
* BSD only has one VRF, if this changes we will need to hook in the
- * right things here to get the id to pass to the address managment
+ * right things here to get the id to pass to the address management
* routine.
*/
if (SCTP_BASE_VAR(first_time) == 0) {
@@ -383,17 +386,7 @@ sctp_get_mbuf_for_msg(unsigned int space_needed, int want_header,
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);
}
@@ -404,9 +397,7 @@ sctp_get_mbuf_for_msg(unsigned int space_needed, int want_header,
}
#ifdef SCTP_MBUF_LOGGING
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) {
- if (SCTP_BUF_IS_EXTENDED(m)) {
- sctp_log_mb(m, SCTP_MBUF_IALLOC);
- }
+ sctp_log_mb(m, SCTP_MBUF_IALLOC);
}
#endif
return (m);