From: Wang Chen <wangchen@cn.fujitsu.com>
To: David Miller <davem@davemloft.net>
Cc: yoshfuji@linux-ipv6.org, netdev@vger.kernel.org
Subject: Re: [PATCH] RAW6: Do not allow set IPV6_CHECKSUM for ICMPv6 socket
Date: Sun, 20 Apr 2008 15:18:52 +0800 [thread overview]
Message-ID: <480AEE5C.4090402@cn.fujitsu.com> (raw)
In-Reply-To: <20080418.040949.87112742.davem@davemloft.net>
David Miller said the following on 2008-4-18 19:09:
> From: Wang Chen <wangchen@cn.fujitsu.com>
> Date: Fri, 18 Apr 2008 18:32:46 +0800
>
>> As RFC3542 mentions: An attempt to set IPV6_CHECKSUM for an
>> ICMPv6 socket will fail.
>> Add a check for that in do_rawv6_setsockopt().
>>
>> Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
>
> Enforcing these kinds of things we've allowed for so many years is
> rather pointless, especially if it breaks real applications. Which I
> believe it does in this case. The standards simply do not matter.
>
> I seem to recall that traceroute6 in iputils does exactly this.
>
Enforcing this can forbid disabling checksum for icmpv6 socket.
The real applications, such as ping6 & traceroute6, are just doing
what is default in kernel.
Why not remove the RFC-breaking code from applications?
See the source:
kernel->rawv6_init_sk()
---
case IPPROTO_ICMPV6:
rp->checksum = 1;
rp->offset = 2;
break;
---
ping6->main()
---
csum_offset = 2;
sz_opt = sizeof(int);
err = setsockopt(icmp_sock, SOL_RAW, IPV6_CHECKSUM, &csum_offset, sz_opt);
if (err < 0) {
perror("setsockopt(RAW_CHECKSUM)");
exit(2);
}
---
traceroute6->main()
---
on = 2;
if (setsockopt(icmp_sock, SOL_RAW, IPV6_CHECKSUM, &on, sizeof(on)) < 0) {
perror("setsockopt(RAW_CHECKSUM)");
exit(2);
}
---
next prev parent reply other threads:[~2008-04-20 7:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-18 10:32 [PATCH] RAW6: Do not allow set IPV6_CHECKSUM for ICMPv6 socket Wang Chen
2008-04-18 11:09 ` David Miller
2008-04-20 7:18 ` Wang Chen [this message]
2008-04-20 7:33 ` David Miller
2008-04-20 9:18 ` Wang Chen
2008-04-20 9:38 ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-20 9:37 ` David Miller
[not found] ` <dd9c5f130804200342r4bdc938fq4af15c9747ba6e06@mail.gmail.com>
2008-04-24 10:48 ` David Miller
2008-04-24 12:19 ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-24 15:26 ` Rémi Denis-Courmont
2008-04-25 1:03 ` Wang Chen
2008-04-25 4:46 ` David Miller
2008-04-25 4:31 ` 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=480AEE5C.4090402@cn.fujitsu.com \
--to=wangchen@cn.fujitsu.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.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).