Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=02c4e12c6400b6dccdc6b5c2c18325551e4b2dc9
Commit:     02c4e12c6400b6dccdc6b5c2c18325551e4b2dc9
Parent:     a09c83847b664dcd67a72613374061c900afb799
Author:     Wei Yongjun <[EMAIL PROTECTED]>
AuthorDate: Fri Aug 31 10:03:58 2007 +0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Tue Sep 25 22:55:46 2007 -0700

    SCTP: Send ABORT chunk with correct tag in response to INIT ACK
    
    When SCTP client received an INIT ACK chunk with missing mandatory
    parameter such as "cookie parameter", it will send back a ABORT
    with T-bit not set and verification tag is set to 0.
    This is because before we accept this INIT ACK chunk, we do not know
    the peer's tag.  This patch change to reflect vtag when responding to
    INIT ACK with missing mandatory parameter.
    
    Signed-off-by: Wei Yongjun <[EMAIL PROTECTED]>
    Signed-off-by: Vlad Yasevich <[EMAIL PROTECTED]>
---
 net/sctp/sm_statefuns.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 177528e..385f175 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -5176,7 +5176,22 @@ static struct sctp_packet *sctp_ootb_pkt_new(const 
struct sctp_association *asoc
         * association exists, otherwise, use the peer's vtag.
         */
        if (asoc) {
-               vtag = asoc->peer.i.init_tag;
+               /* Special case the INIT-ACK as there is no peer's vtag
+                * yet.
+                */
+               switch(chunk->chunk_hdr->type) {
+               case SCTP_CID_INIT_ACK:
+               {
+                       sctp_initack_chunk_t *initack;
+
+                       initack = (sctp_initack_chunk_t *)chunk->chunk_hdr;
+                       vtag = ntohl(initack->init_hdr.init_tag);
+                       break;
+               }
+               default:
+                       vtag = asoc->peer.i.init_tag;
+                       break;
+               }
        } else {
                /* Special case the INIT and stale COOKIE_ECHO as there is no
                 * vtag yet.
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to