diff options
author | tuexen <tuexen@FreeBSD.org> | 2011-12-27 10:16:24 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2011-12-27 10:16:24 +0000 |
commit | b9ef107414848cd42bfb431cc80e5187bdfb53fa (patch) | |
tree | ce50f6b6186eabeaf9efcd3c9f23634ecb1ea357 /sys/netinet/sctp_var.h | |
parent | b0b064ff30f64fde4b2fc99c2dc6c840ecb6a95c (diff) | |
download | FreeBSD-src-b9ef107414848cd42bfb431cc80e5187bdfb53fa.zip FreeBSD-src-b9ef107414848cd42bfb431cc80e5187bdfb53fa.tar.gz |
Address issues found by clang. While there, fix also some style
issues.
MFC after: 3 months.
Diffstat (limited to 'sys/netinet/sctp_var.h')
-rw-r--r-- | sys/netinet/sctp_var.h | 13 |
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); \ |