netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* why do we mangle checksums for v6 ICMP?
@ 2006-11-08 22:13 Al Viro
  2006-11-08 22:28 ` Al Viro
  2006-11-09 17:32 ` Brian Haley
  0 siblings, 2 replies; 26+ messages in thread
From: Al Viro @ 2006-11-08 22:13 UTC (permalink / raw)
  To: netdev

	AFAICS, the rules are:

(1) checksum is 16-bit one's complement of the one's complement sum of
relevant 16bit words.

(2) for v4 UDP all-zeroes has special meaning - no checksum; if you get
it from (1), send all-ones instead.

(3) for v6 UDP we have the same remapping as in (2), but all-zeroes has
different meaning - not "ignore checksum" as in v4, but "reject the
packet".

(4) there is no (4).

	IOW, nobody except UDP has any business doing that 0->0xffff
replacement.  However, we have
       if (icmp6h->icmp6_cksum == 0)
               icmp6h->icmp6_cksum = -1;
and similar in net/ipv6/raw.c

AFAICS, both went in with (commit ID by linux-hist repository)
commit 6bac90985c8b65ffc25839c001aa7ef4831d2915
Author: Kazunori Miyazawa <kazunori@miyazawa.org>
Date:   Mon May 12 00:21:19 2003 -0700

    [IPV4]: Introduce ip6_append_data.

That changeset has very similar changes done in udp.c, icmp.c and raw.c;
remapping of UDP checksum used to be in the area affected by the changeset
and it looks like it got not just preserved in udp.c (as it should), but
copied to icmp.c and raw.c instances.

So... is it really needed there?

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

end of thread, other threads:[~2006-11-14  1:52 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-08 22:13 why do we mangle checksums for v6 ICMP? Al Viro
2006-11-08 22:28 ` Al Viro
2006-11-09 17:32 ` Brian Haley
2006-11-09 23:14   ` David Miller
2006-11-10 16:24     ` [PATCH] IPv6: only modify checksum for UDP Brian Haley
2006-11-10 17:54       ` David Stevens
2006-11-14  0:50         ` David Miller
2006-11-14  1:18           ` Al Viro
2006-11-14  1:44           ` David Stevens
2006-11-14  1:52             ` Al Viro
2006-11-10 22:55       ` David Miller
2006-11-10 23:17         ` Nivedita Singhvi
2006-11-10 23:26           ` David Miller
2006-11-10 23:36             ` Nivedita Singhvi
2006-11-12  1:30             ` Brian Haley
2006-11-10 16:25     ` [PATCH] IPv6: optimize echo reply checksum calculation Brian Haley
2006-11-10 17:34       ` Al Viro
2006-11-10 17:51         ` Brian Haley
2006-11-10 18:05           ` Al Viro
2006-11-10 18:20             ` Al Viro
2006-11-10 19:04               ` Brian Haley
2006-11-10 19:17                 ` Al Viro
2006-11-10 21:06                   ` Brian Haley
2006-11-11  1:45                     ` Al Viro
2006-11-11 18:07     ` why do we mangle checksums for v6 ICMP? Bill Fink
2006-11-13  7:04       ` David Miller

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).