Commit:     8d614ade511fef11f992d6a73e538d33b3b81f12
Parent:     ab3e5e7b65dde661f5eb86b445496c5967283333
Author:     Wei Yongjun <[EMAIL PROTECTED]>
AuthorDate: Mon Aug 6 13:55:47 2007 +0800
Committer:  Vlad Yasevich <[EMAIL PROTECTED]>
CommitDate: Thu Aug 30 11:56:17 2007 -0400

    SCTP: Fix sctp_addto_chunk() to add pad with correct length
    At function sctp_addto_chunk(), it do pad before add payload to chunk if
    chunk length is not 4-byte alignment. But it do pad with a bad length.
    This patch fixed this probleam.
    Signed-off-by: Wei Yongjun <[EMAIL PROTECTED]>
    Signed-off-by: Vlad Yasevich <[EMAIL PROTECTED]>
 net/sctp/sm_make_chunk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 2b1129a..93df833 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1128,7 +1128,7 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, 
const void *data)
        void *target;
        void *padding;
        int chunklen = ntohs(chunk->chunk_hdr->length);
-       int padlen = chunklen % 4;
+       int padlen = WORD_ROUND(chunklen) - chunklen;
        padding = skb_put(chunk->skb, padlen);
        target = skb_put(chunk->skb, len);
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

Reply via email to