summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2014-09-07 18:05:37 +0000
committertuexen <tuexen@FreeBSD.org>2014-09-07 18:05:37 +0000
commit53f889f7e3a5264e8163257f3aa0877c76b04bc5 (patch)
tree428e48861a6c44ba677f1db46d3d9b6f7952b9a9
parentc7b009940d9f8b971c3a2cb166bc9d3096d0649f (diff)
downloadFreeBSD-src-53f889f7e3a5264e8163257f3aa0877c76b04bc5.zip
FreeBSD-src-53f889f7e3a5264e8163257f3aa0877c76b04bc5.tar.gz
Address warnings generated by the clang analyzer.
MFC after: 1 week
-rw-r--r--sys/netinet/sctp_input.c4
-rw-r--r--sys/netinet/sctp_output.c4
-rw-r--r--sys/netinet/sctp_pcb.c1
3 files changed, 4 insertions, 5 deletions
diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c
index 66c2ac7..fa108a3 100644
--- a/sys/netinet/sctp_input.c
+++ b/sys/netinet/sctp_input.c
@@ -2882,9 +2882,9 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *cp SCTP_UNUSED,
SCTPDBG(SCTP_DEBUG_INPUT2,
"sctp_handle_cookie_ack: handling COOKIE-ACK\n");
- if (stcb == NULL)
+ if ((stcb == NULL) || (net == NULL)) {
return;
-
+ }
asoc = &stcb->asoc;
sctp_stop_all_cookie_timers(stcb);
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index 839d8e2..6dfc5cf 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -5921,8 +5921,8 @@ do_a_abort:
parameter_len = (uint16_t) sizeof(struct sctp_paramhdr);
ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+chunk_len);
ph->param_type = htons(SCTP_HAS_NAT_SUPPORT);
- ph->param_length = htons(sizeof(struct sctp_paramhdr));
- chunk_len += sizeof(struct sctp_paramhdr);
+ ph->param_length = htons(parameter_len);
+ chunk_len += parameter_len;
}
/* And now tell the peer which extensions we support */
num_ext = 0;
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index 0eb0ad2..45de221 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -6123,7 +6123,6 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
peer_supports_prsctp = 0;
peer_supports_auth = 0;
peer_supports_asconf = 0;
- peer_supports_asconf = 0;
peer_supports_reconfig = 0;
peer_supports_nrsack = 0;
peer_supports_pktdrop = 0;
OpenPOWER on IntegriCloud