All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipv6: fix raw socket checksum for udplite
@ 2013-03-26 22:31 Maciej Żenczykowski
  2013-03-27  2:30 ` Brian Haley
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej Żenczykowski @ 2013-03-26 22:31 UTC (permalink / raw)
  To: Maciej Żenczykowski, David S. Miller
  Cc: netdev, Eric Dumazet, Mike Dalton, Brian Haley

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ipv6: fix raw socket checksum for udplite
  2013-03-26 22:31 [PATCH] ipv6: fix raw socket checksum for udplite Maciej Żenczykowski
@ 2013-03-27  2:30 ` Brian Haley
  2013-03-27  4:55   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Haley @ 2013-03-27  2:30 UTC (permalink / raw)
  To: Maciej Żenczykowski
  Cc: Maciej Żenczykowski, David S. Miller, netdev, Eric Dumazet,
	Mike Dalton

On 03/26/2013 06:31 PM, Maciej Żenczykowski wrote:
> From: Maciej Żenczykowski <maze@google.com>
> 
> Commit d3a1be9cba86 from Brian Haley in Nov 2006
> "[IPv6]: Only modify checksum for UDP" forgot about
> UDPLITE.

I'm not sure I'd say I "forgot about" it, UDPLITE support didn't exist in Linux
until three+ weeks after that commit.

commit d3a1be9cba86c4385a5fe46673bbb4730551f454
Author: Brian Haley <brian.haley@hp.com>
Date:   Fri Nov 10 14:54:51 2006 -0800

    [IPv6]: Only modify checksum for UDP

commit ba4e58eca8aa9473b44fdfd312f26c4a2e7798b3
Author: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Date:   Mon Nov 27 11:10:57 2006 -0800

    [NET]: Supporting UDP-Lite (RFC 3828) in Linux

I see no reason your patch isn't correct though.

Acked-by: Brian Haley <brian.haley@hp.com>

-Brian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ipv6: fix raw socket checksum for udplite
  2013-03-27  2:30 ` Brian Haley
@ 2013-03-27  4:55   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-03-27  4:55 UTC (permalink / raw)
  To: brian.haley; +Cc: zenczykowski, maze, netdev, edumazet, mwdalton

From: Brian Haley <brian.haley@hp.com>
Date: Tue, 26 Mar 2013 22:30:25 -0400

> On 03/26/2013 06:31 PM, Maciej Żenczykowski wrote:
>> From: Maciej Żenczykowski <maze@google.com>
>> 
>> Commit d3a1be9cba86 from Brian Haley in Nov 2006
>> "[IPv6]: Only modify checksum for UDP" forgot about
>> UDPLITE.
> 
> I'm not sure I'd say I "forgot about" it, UDPLITE support didn't exist in Linux
> until three+ weeks after that commit.

Maciej, please fix the commit message to not blame that commit, and
resubmit, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-27  4:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-26 22:31 [PATCH] ipv6: fix raw socket checksum for udplite Maciej Żenczykowski
2013-03-27  2:30 ` Brian Haley
2013-03-27  4:55   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.