From: "Maciej Żenczykowski" <zenczykowski@gmail.com>
To: "Maciej Żenczykowski" <maze@google.com>,
"David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
Mike Dalton <mwdalton@google.com>,
Brian Haley <brian.haley@hp.com>
Subject: [PATCH] ipv6: fix raw socket checksum for udplite
Date: Tue, 26 Mar 2013 15:31:35 -0700 [thread overview]
Message-ID: <1364337095-19663-1-git-send-email-zenczykowski@gmail.com> (raw)
From: Maciej Żenczykowski <maze@google.com>
Commit d3a1be9cba86 from Brian Haley in Nov 2006
"[IPv6]: Only modify checksum for UDP" forgot about
UDPLITE.
(Not clear if this fix is sufficient for udp over raw6 socket
checksumming in kernel to be useful, but it's obviously wrong
as is.)
RFC 3828 section 3.1, 3rd paragraph:
If the computed checksum is 0, it is transmitted as all ones
(the equivalent in one's complement arithmetic).
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Mike Dalton <mwdalton@google.com>
Cc: Brian Haley <brian.haley@hp.com>
---
net/ipv6/raw.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index eedff8ccded5..745e925eff17 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -590,7 +590,8 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
csum = csum_ipv6_magic(&fl6->saddr, &fl6->daddr,
total_len, fl6->flowi6_proto, tmp_csum);
- if (csum == 0 && fl6->flowi6_proto == IPPROTO_UDP)
+ if (csum == 0 && (fl6->flowi6_proto == IPPROTO_UDP
+ || fl6->flowi6_proto == IPPROTO_UDPLITE))
csum = CSUM_MANGLED_0;
if (skb_store_bits(skb, offset, &csum, 2))
--
1.8.1.3
next reply other threads:[~2013-03-26 22:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-26 22:31 Maciej Żenczykowski [this message]
2013-03-27 2:30 ` [PATCH] ipv6: fix raw socket checksum for udplite Brian Haley
2013-03-27 4:55 ` David Miller
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=1364337095-19663-1-git-send-email-zenczykowski@gmail.com \
--to=zenczykowski@gmail.com \
--cc=brian.haley@hp.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=maze@google.com \
--cc=mwdalton@google.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).