From: Vlad Yasevich <[EMAIL PROTECTED]>
Date: Fri, 18 Jan 2008 21:17:56 -0500

> Hmm... in the code I am looking at, it's set in both zero and
> non-zero cases so it does solve the issue.
> 
> So does initializing it to NO_ERROR like you did.

Here is the code block in question in net-2.6.25:

        /* Verify the INIT chunk before processing it. */
        err_chunk = NULL;
        if (!sctp_verify_init(asoc, chunk->chunk_hdr->type,
                              (sctp_init_chunk_t *)chunk->chunk_hdr, chunk,
                              &err_chunk)) {
 ...
                if (err_chunk) {
 ...
                        if (packet) {
                                sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT,
                                                SCTP_PACKET(packet));
                                SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
                                error = SCTP_ERROR_INV_PARAM;
                        } else {
                                error = SCTP_ERROR_NO_RESOURCE;
                        }
                }
 ...
                return sctp_stop_t1_and_abort(commands, error, ECONNREFUSED,
                                                asoc, chunk->transport);

If err_chunk == NULL at the "if (err_chunk)" test, error
will be left uninitialized, even after being moved as you
have suggested (right after the sctp_verify_init() call).

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to