]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/sctp/sm_statefuns.c
SCTP: Send ABORT chunk with correct tag in response to INIT ACK
[mv-sheeva.git] / net / sctp / sm_statefuns.c
index 177528ed3e1b1d9f50ea2c9be844d5a5d0553187..385f1757158a3272c50ce20099563b5d78055e9e 100644 (file)
@@ -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.