diff options
author | Marco Varlese <marco.varlese@suse.com> | 2018-04-17 16:41:51 +0200 |
---|---|---|
committer | Marco Varlese <marco.varlese@suse.com> | 2018-04-17 16:49:25 +0200 |
commit | 216c35b2c6e5b4a728675f5141241420841cda34 (patch) | |
tree | 1ec6b8fae7fda39b63eb56ebf14851702f1765e5 /src/vnet/sctp/sctp_output.c | |
parent | 0f4b184757557d2f1221c0df92413381ac4d7c08 (diff) |
SCTP: coverity scan warnings
This patch addresses 182346, 182347, 182353.
Change-Id: I59c3d74bd3a2122b836c93e22ddb632fa032f7fe
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
Diffstat (limited to 'src/vnet/sctp/sctp_output.c')
-rw-r--r-- | src/vnet/sctp/sctp_output.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vnet/sctp/sctp_output.c b/src/vnet/sctp/sctp_output.c index 8ce94c6f3a2..e2738e90c09 100644 --- a/src/vnet/sctp/sctp_output.c +++ b/src/vnet/sctp/sctp_output.c @@ -868,7 +868,7 @@ sctp_prepare_initack_chunk_for_collision (sctp_connection_t * sctp_conn, void sctp_prepare_initack_chunk (sctp_connection_t * sctp_conn, u8 idx, vlib_buffer_t * b, ip4_address_t * ip4_addr, - ip6_address_t * ip6_addr) + u8 add_ip4, ip6_address_t * ip6_addr, u8 add_ip6) { vlib_main_t *vm = vlib_get_main (); sctp_ipv4_addr_param_t *ip4_param = 0; @@ -881,12 +881,12 @@ sctp_prepare_initack_chunk (sctp_connection_t * sctp_conn, u8 idx, u16 alloc_bytes = sizeof (sctp_init_ack_chunk_t) + sizeof (sctp_state_cookie_param_t); - if (PREDICT_TRUE (ip4_addr != NULL)) + if (PREDICT_FALSE (add_ip4 == 1)) { /* Create room for variable-length fields in the INIT_ACK chunk */ alloc_bytes += SCTP_IPV4_ADDRESS_TYPE_LENGTH; } - if (PREDICT_TRUE (ip6_addr != NULL)) + if (PREDICT_FALSE (add_ip6 == 1)) { /* Create room for variable-length fields in the INIT_ACK chunk */ alloc_bytes += SCTP_IPV6_ADDRESS_TYPE_LENGTH; |