summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_input.c
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2007-07-21 21:41:32 +0000
committerrrs <rrs@FreeBSD.org>2007-07-21 21:41:32 +0000
commit1918b8aea1b783fd107c45b78b7634bc87e85b0d (patch)
treec2edc32d56ce6b03518615a225c4c10558ee679e /sys/netinet/sctp_input.c
parent5eb246dfe4a78e28f4d05c5cb07e44a47b179e82 (diff)
downloadFreeBSD-src-1918b8aea1b783fd107c45b78b7634bc87e85b0d.zip
FreeBSD-src-1918b8aea1b783fd107c45b78b7634bc87e85b0d.tar.gz
- remove duplicate code from sctp_asconf.c
- remove duplicate #include <sys/priv.h> that is not under #ifdef FreeBSD version to allow compile on 6.1 - static analysis changes per the cisco SA tool including: o some SA_IGNORE comments o some checks for NULL before unlock. o type corrections int -> size_t - Fix it so sctp_alloc_asoc takes a thread/proc argument. Without this we pass a NULL in to bind on implicit assoc setup and crash :-( Approved by: re@freebsd.org(Ken Smith)
Diffstat (limited to 'sys/netinet/sctp_input.c')
-rw-r--r--sys/netinet/sctp_input.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c
index 0bf48bc..c426cd6 100644
--- a/sys/netinet/sctp_input.c
+++ b/sys/netinet/sctp_input.c
@@ -186,8 +186,8 @@ sctp_is_there_unsent_data(struct sctp_tcb *stcb)
if (!TAILQ_EMPTY(&asoc->out_wheel)) {
/* Check to see if some data queued */
TAILQ_FOREACH(strq, &asoc->out_wheel, next_spoke) {
- /* sa_ignore FREED_MEMORY */
is_there_another:
+ /* sa_ignore FREED_MEMORY */
sp = TAILQ_FIRST(&strq->outqueue);
if (sp == NULL) {
continue;
@@ -1620,8 +1620,17 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
* now that we know the INIT/INIT-ACK are in place, create a new TCB
* and popluate
*/
+
+ /*
+ * Here we do a trick, we set in NULL for the proc/thread argument.
+ * We do this since in effect we only use the p argument when the
+ * socket is unbound and we must do an implicit bind. Since we are
+ * getting a cookie, we cannot be unbound.
+ */
stcb = sctp_aloc_assoc(inp, init_src, 0, &error,
- ntohl(initack_cp->init.initiate_tag), vrf_id);
+ ntohl(initack_cp->init.initiate_tag), vrf_id,
+ (struct thread *)NULL
+ );
if (stcb == NULL) {
struct mbuf *op_err;
@@ -4601,6 +4610,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset,
vrf_id);
SCTP_TCB_UNLOCK(stcb);
goto out_now;
+ /* sa_ignore NOTREACHED */
break;
case SCTP_STATE_EMPTY: /* should not happen */
case SCTP_STATE_INUSE: /* should not happen */
@@ -4609,6 +4619,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset,
default:
SCTP_TCB_UNLOCK(stcb);
goto out_now;
+ /* sa_ignore NOTREACHED */
break;
case SCTP_STATE_OPEN:
case SCTP_STATE_SHUTDOWN_SENT:
OpenPOWER on IntegriCloud