]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
SCTP: Fix to handle invalid parameter length correctly
authorWei Yongjun <yjwei@cn.fujitsu.com>
Mon, 6 Aug 2007 05:55:58 +0000 (13:55 +0800)
committerVlad Yasevich <vladislav.yasevich@hp.com>
Thu, 30 Aug 2007 20:44:27 +0000 (16:44 -0400)
If an INIT with invalid parameter length look like this:
Parameter Type : 1
Parameter Length: 800
and not contain any payload, SCTP will ignore this  parameter and send
back a INIT-ACK.
This patch is fix to handle this invalid parameter length correctly.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
net/sctp/sm_make_chunk.c

index adc5e593472802812b8fd2095c4e05f2922a8f58..79856c9245252af44f4b9d793ec8a746fa5cc40f 100644 (file)
@@ -1833,7 +1833,7 @@ int sctp_verify_init(const struct sctp_association *asoc,
         * VIOLATION error.  We build the ERROR chunk here and let the normal
         * error handling code build and send the packet.
         */
-       if (param.v < (void*)chunk->chunk_end - sizeof(sctp_paramhdr_t)) {
+       if (param.v != (void*)chunk->chunk_end) {
                sctp_process_inv_paramlength(asoc, param.p, chunk, errp);
                return 0;
        }