summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_var.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/sctp_var.h')
-rw-r--r--sys/netinet/sctp_var.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/netinet/sctp_var.h b/sys/netinet/sctp_var.h
index 09c0dd8..24c5544 100644
--- a/sys/netinet/sctp_var.h
+++ b/sys/netinet/sctp_var.h
@@ -53,27 +53,28 @@ extern struct pr_usrreqs sctp_usrreqs;
#define sctp_stcb_feature_on(inp, stcb, feature) {\
if (stcb) { \
stcb->asoc.sctp_features |= feature; \
- } else { \
+ } else if (inp) { \
inp->sctp_features |= feature; \
} \
}
#define sctp_stcb_feature_off(inp, stcb, feature) {\
if (stcb) { \
stcb->asoc.sctp_features &= ~feature; \
- } else { \
+ } else if (inp) { \
inp->sctp_features &= ~feature; \
} \
}
#define sctp_stcb_is_feature_on(inp, stcb, feature) \
(((stcb != NULL) && \
((stcb->asoc.sctp_features & feature) == feature)) || \
- ((stcb == NULL) && \
+ ((stcb == NULL) && (inp != NULL) && \
((inp->sctp_features & feature) == feature)))
#define sctp_stcb_is_feature_off(inp, stcb, feature) \
(((stcb != NULL) && \
((stcb->asoc.sctp_features & feature) == 0)) || \
- ((stcb == NULL) && \
- ((inp->sctp_features & feature) == 0)))
+ ((stcb == NULL) && (inp != NULL) && \
+ ((inp->sctp_features & feature) == 0)) || \
+ ((stcb == NULL) && (inp == NULL)))
/* managing mobility_feature in inpcb (by micchie) */
#define sctp_mobility_feature_on(inp, feature) (inp->sctp_mobility_features |= feature)
@@ -235,7 +236,7 @@ extern struct pr_usrreqs sctp_usrreqs;
#define sctp_mbuf_crush(data) do { \
struct mbuf *_m; \
_m = (data); \
- while(_m && (SCTP_BUF_LEN(_m) == 0)) { \
+ while (_m && (SCTP_BUF_LEN(_m) == 0)) { \
(data) = SCTP_BUF_NEXT(_m); \
SCTP_BUF_NEXT(_m) = NULL; \
sctp_m_free(_m); \
OpenPOWER on IntegriCloud