From: David Miller <davem@davemloft.net>
To: nickolay@protei.ru
Cc: linux-kernel@vger.kernel.org, linux-sctp@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: SCTP checksum patch for 2.6.26.5
Date: Mon, 22 Sep 2008 13:12:45 -0700 (PDT) [thread overview]
Message-ID: <20080922.131245.193705447.davem@davemloft.net> (raw)
In-Reply-To: <48D7C0A2.9090406@protei.ru>
From: Nickolay Vinogradov <nickolay@protei.ru>
Date: Mon, 22 Sep 2008 19:58:26 +0400
CC:'ing correct mailing lists...
> SCTP checksum calculation fix for BigEndian.
> ntohl() doesn't do anything on BigEndian.
>
> diff --git a/Makefile b/Makefile
> diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h
> index ba75c67..2f0ed64 100644
> --- a/include/net/sctp/checksum.h
> +++ b/include/net/sctp/checksum.h
> @@ -74,5 +74,19 @@ static inline __u32 sctp_update_cksum(__u8 *buffer, __u16 length, __u32 crc32)
>
> static inline __u32 sctp_end_cksum(__u32 crc32)
> {
> - return ntohl(~crc32);
> + __u32 result;
> + __u8 byte0, byte1, byte2, byte3;
> +
> + result = ~crc32;
> +
> + byte0 = result & 0xff;
> + byte1 = (result>>8) & 0xff;
> + byte2 = (result>>16) & 0xff;
> + byte3 = (result>>24) & 0xff;
> +
> + crc32 = ((byte0 << 24) |
> + (byte1 << 16) |
> + (byte2 << 8) |
> + byte3);
> + return crc32;
> }
> diff --git a/net/sctp/output.c b/net/sctp/output.c
>
>
> -- Nickolay Vinogradov
> Protei Research and Development Center
> St.Petersburg, 194044, Russia
> Tel.: +7 812 449 47 27
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2008-09-22 20:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-22 15:58 Nickolay Vinogradov
2008-09-22 20:12 ` David Miller [this message]
2008-09-22 20:36 ` Vlad Yasevich
2008-09-23 5:19 ` Willy Tarreau
2008-09-23 5:45 ` Harvey Harrison
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080922.131245.193705447.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sctp@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nickolay@protei.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®