* [PATCH 2/2] [IPV6] RAW: Add checksum default defines for mobility header.
@ 2006-12-05 10:03 Masahide NAKAMURA
2006-12-05 11:02 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 1 reply; 9+ messages in thread
From: Masahide NAKAMURA @ 2006-12-05 10:03 UTC (permalink / raw)
To: davem; +Cc: yoshfuji, netdev, Masahide NAKAMURA
Add checksum default defines for mobility header(MH).
As the result kernel's behavior is to handle MH checksum
as default.
Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
---
net/ipv6/raw.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index aa1d420..389fa32 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -1095,10 +1095,21 @@ static void rawv6_close(struct sock *sk,
static int rawv6_init_sk(struct sock *sk)
{
- if (inet_sk(sk)->num == IPPROTO_ICMPV6) {
- struct raw6_sock *rp = raw6_sk(sk);
+ struct raw6_sock *rp = raw6_sk(sk);
+
+ switch (inet_sk(sk)->num) {
+ case IPPROTO_ICMPV6:
rp->checksum = 1;
rp->offset = 2;
+ break;
+#ifdef CONFIG_IPV6_MIP6
+ case IPPROTO_MH:
+ rp->checksum = 1;
+ rp->offset = 4;
+ break;
+#endif
+ default:
+ break;
}
return(0);
}
--
1.4.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] [IPV6] RAW: Add checksum default defines for mobility header.
2006-12-05 10:03 [PATCH 2/2] [IPV6] RAW: Add checksum default defines for mobility header Masahide NAKAMURA
@ 2006-12-05 11:02 ` YOSHIFUJI Hideaki / 吉藤英明
2006-12-05 15:04 ` Brian Haley
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2006-12-05 11:02 UTC (permalink / raw)
To: davem, nakam; +Cc: netdev, yoshfuji
In article <11653130071739-git-send-email-nakam@linux-ipv6.org> (at Tue, 5 Dec 2006 19:03:27 +0900), Masahide NAKAMURA <nakam@linux-ipv6.org> says:
> Add checksum default defines for mobility header(MH).
> As the result kernel's behavior is to handle MH checksum
> as default.
I'd like to hold this on. I need to check RFC.
--yoshfuji
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] [IPV6] RAW: Add checksum default defines for mobility header.
2006-12-05 11:02 ` YOSHIFUJI Hideaki / 吉藤英明
@ 2006-12-05 15:04 ` Brian Haley
2006-12-05 15:28 ` YOSHIFUJI Hideaki / 吉藤英明
2006-12-05 21:49 ` David Miller
2006-12-11 6:50 ` David Miller
2 siblings, 1 reply; 9+ messages in thread
From: Brian Haley @ 2006-12-05 15:04 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / ????; +Cc: davem, nakam, netdev
YOSHIFUJI Hideaki / ???? wrote:
>> Add checksum default defines for mobility header(MH).
>> As the result kernel's behavior is to handle MH checksum
>> as default.
>
> I'd like to hold this on. I need to check RFC.
That looks correct according to 3775.
-Brian
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] [IPV6] RAW: Add checksum default defines for mobility header.
2006-12-05 15:04 ` Brian Haley
@ 2006-12-05 15:28 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 0 replies; 9+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2006-12-05 15:28 UTC (permalink / raw)
To: brian.haley; +Cc: davem, nakam, netdev, yoshfuji
In article <45758A6E.9010209@hp.com> (at Tue, 05 Dec 2006 10:04:14 -0500), Brian Haley <brian.haley@hp.com> says:
> YOSHIFUJI Hideaki wrote:
> >> Add checksum default defines for mobility header(MH).
> >> As the result kernel's behavior is to handle MH checksum
> >> as default.
> >
> > I'd like to hold this on. I need to check RFC.
>
> That looks correct according to 3775.
I'm thinking about difference RFC.
--yoshfuji
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] [IPV6] RAW: Add checksum default defines for mobility header.
2006-12-05 11:02 ` YOSHIFUJI Hideaki / 吉藤英明
2006-12-05 15:04 ` Brian Haley
@ 2006-12-05 21:49 ` David Miller
2006-12-11 6:50 ` David Miller
2 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2006-12-05 21:49 UTC (permalink / raw)
To: yoshfuji; +Cc: nakam, netdev
From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Tue, 05 Dec 2006 20:02:42 +0900 (JST)
> In article <11653130071739-git-send-email-nakam@linux-ipv6.org> (at Tue, 5 Dec 2006 19:03:27 +0900), Masahide NAKAMURA <nakam@linux-ipv6.org> says:
>
> > Add checksum default defines for mobility header(MH).
> > As the result kernel's behavior is to handle MH checksum
> > as default.
>
> I'd like to hold this on. I need to check RFC.
Ok.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] [IPV6] RAW: Add checksum default defines for mobility header.
2006-12-05 11:02 ` YOSHIFUJI Hideaki / 吉藤英明
2006-12-05 15:04 ` Brian Haley
2006-12-05 21:49 ` David Miller
@ 2006-12-11 6:50 ` David Miller
2006-12-27 2:14 ` YOSHIFUJI Hideaki / 吉藤英明
2 siblings, 1 reply; 9+ messages in thread
From: David Miller @ 2006-12-11 6:50 UTC (permalink / raw)
To: yoshfuji; +Cc: nakam, netdev
From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Tue, 05 Dec 2006 20:02:42 +0900 (JST)
> In article <11653130071739-git-send-email-nakam@linux-ipv6.org> (at Tue, 5 Dec 2006 19:03:27 +0900), Masahide NAKAMURA <nakam@linux-ipv6.org> says:
>
> > Add checksum default defines for mobility header(MH).
> > As the result kernel's behavior is to handle MH checksum
> > as default.
>
> I'd like to hold this on. I need to check RFC.
Is there any resolution about this?
Thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] [IPV6] RAW: Add checksum default defines for mobility header.
2006-12-11 6:50 ` David Miller
@ 2006-12-27 2:14 ` YOSHIFUJI Hideaki / 吉藤英明
2006-12-27 4:57 ` Masahide NAKAMURA
0 siblings, 1 reply; 9+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2006-12-27 2:14 UTC (permalink / raw)
To: davem; +Cc: nakam, netdev, yoshfuji
Happy Holidays!
In article <20061210.225055.45514229.davem@davemloft.net> (at Sun, 10 Dec 2006 22:50:55 -0800 (PST)), David Miller <davem@davemloft.net> says:
> From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> Date: Tue, 05 Dec 2006 20:02:42 +0900 (JST)
>
> > In article <11653130071739-git-send-email-nakam@linux-ipv6.org> (at Tue, 5 Dec 2006 19:03:27 +0900), Masahide NAKAMURA <nakam@linux-ipv6.org> says:
> >
> > > Add checksum default defines for mobility header(MH).
> > > As the result kernel's behavior is to handle MH checksum
> > > as default.
> >
> > I'd like to hold this on. I need to check RFC.
>
> Is there any resolution about this?
Sorry to have kept you waiting.
According to RFC4584 (Extension to Sockets API for Mobile IPv6) Section 6.1
(Receiving and Sending Mobility Header Messages), an implementation that
supports the Mobile IPv6 API must implement Mobility Header API checksum
calculations by default at the kernel. This is true in our kernel so far
because we always performs it in net/ipv6/raw.c:mip6_mh_filter().
However, the default value for IPV6_CHECKSUM socket option was not 4
but -1, which is inconsistent.
So, the proposed patch tried changing the default for IPV6_CHECKSUM.
But, wait... currently, we cannot disable checksumming by IPV6_CHECKSUM
for IPPROTO_MH sockets while we can do it for IPPROTO_ICMPV6 sockets.
This is still not good.
RFC3775 Section 9.2 (Processing Mobility Headers) says that
Mobile IPv6 implementation must observe the following items:
- Checksum (-> silently discard)
Note: calculated by the common IPv6 checksum algorithm and
its offset in MH is 4.
- MH Type (-> Binding Error)
- Payload protocol (-> ICMPv6 Parameter Problem)
- Length (-> ICMPv6 Parameter Problem)
Note: The order of these checks is not specified.
In Linux, mip6_mh_filter() performs basic checks for Mobile Header,
which corresponds to RFC3775 Section 9.2:
- Length (depends on MH type)
- Checksum
- Payload protocol
Note: MH is checked in user-space daemon, to send BE.
If it is okay to defer the checksumming after checking the next header
protocol, we can omit the checksumming in mip6_mh_filter(), and
leave it to rawv6_rcv() and rawv6_recvmsg().
Anyway, we have 4 options.
1. IPV6_CHECKSUM default for IPPROTO_MH == 4
omit checksumming in mip6_mh_filter()
2. IPV6_CHECKSUM default for IPPROTO_MH == -1
omit checksumming in mip6_mh_filter()
3. IPV6_CHECKSUM for IPPROTO_MH == 4
always perform checksumming in mip6_mh_filter()
4. IPV6_CHECKSUM default for IPPROTO_MH == -1
always perform checksumming in mip6_mh_filter()
Current behavior is 4, but it is not appropriate.
I guess 1 is the way to go.
Another question may arise; is it okay to change the default if the
raw socket for Mobility Header is NOT for user-space daemon? or,
is it okay to have two different default value depending on CONFIG_IPV6_MIP6?
If we take these question seriously, we should take 2.
Note: in any case, all IPPROTO_MH raw socket users should explicitly set
IPV6_CHECKSUM socket option.
Opinions? Objections?
--
YOSHIFUJI Hideaki @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] [IPV6] RAW: Add checksum default defines for mobility header.
2006-12-27 2:14 ` YOSHIFUJI Hideaki / 吉藤英明
@ 2006-12-27 4:57 ` Masahide NAKAMURA
2006-12-27 5:44 ` Noriaki TAKAMIYA
0 siblings, 1 reply; 9+ messages in thread
From: Masahide NAKAMURA @ 2006-12-27 4:57 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / ????; +Cc: davem, netdev
YOSHIFUJI Hideaki / ???? wrote:
> If it is okay to defer the checksumming after checking the next header
> protocol, we can omit the checksumming in mip6_mh_filter(), and
> leave it to rawv6_rcv() and rawv6_recvmsg().
>
>
> Anyway, we have 4 options.
>
> 1. IPV6_CHECKSUM default for IPPROTO_MH == 4
> omit checksumming in mip6_mh_filter()
> 2. IPV6_CHECKSUM default for IPPROTO_MH == -1
> omit checksumming in mip6_mh_filter()
> 3. IPV6_CHECKSUM for IPPROTO_MH == 4
> always perform checksumming in mip6_mh_filter()
> 4. IPV6_CHECKSUM default for IPPROTO_MH == -1
> always perform checksumming in mip6_mh_filter()
>
> Current behavior is 4, but it is not appropriate.
> I guess 1 is the way to go.
I would like to have 1, too.
> Another question may arise; is it okay to change the default if the
> raw socket for Mobility Header is NOT for user-space daemon? or,
For such application (if any), it has used setsockopt = 4 or hasn't used it
for inbound checksum. Those code should work with the kernel change then I
can not find any issue here. Do you have anything else to be discussed?
> is it okay to have two different default value depending on CONFIG_IPV6_MIP6?
> If we take these question seriously, we should take 2.
We have a solution here, to remove "ifdef CONFIG_IPV6_MIP6" from
rawv6_init_sk() to have the same default value = 4 for IPPROTO_MH
regardless user config.
BTW ICMPv6 default is on and offset = 2. It is better idea for me
to have the similar design for both MH and ICMPv6 as raw socket stuff
than you pointed.
Regards,
--
Masahide NAKAMURA
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] [IPV6] RAW: Add checksum default defines for mobility header.
2006-12-27 4:57 ` Masahide NAKAMURA
@ 2006-12-27 5:44 ` Noriaki TAKAMIYA
0 siblings, 0 replies; 9+ messages in thread
From: Noriaki TAKAMIYA @ 2006-12-27 5:44 UTC (permalink / raw)
To: nakam; +Cc: yoshfuji, davem, netdev
Hi,
>> Wed, 27 Dec 2006 13:57:23 +0900
>> [Subject: Re: [PATCH 2/2] [IPV6] RAW: Add checksum default defines for mobility header.]
>> Masahide NAKAMURA <nakam@linux-ipv6.org> wrote....
> > Anyway, we have 4 options.
> >
> > 1. IPV6_CHECKSUM default for IPPROTO_MH == 4
> > omit checksumming in mip6_mh_filter()
> > 2. IPV6_CHECKSUM default for IPPROTO_MH == -1
> > omit checksumming in mip6_mh_filter()
> > 3. IPV6_CHECKSUM for IPPROTO_MH == 4
> > always perform checksumming in mip6_mh_filter()
> > 4. IPV6_CHECKSUM default for IPPROTO_MH == -1
> > always perform checksumming in mip6_mh_filter()
> >
> > Current behavior is 4, but it is not appropriate.
> > I guess 1 is the way to go.
>
> I would like to have 1, too.
I think 1. is suitable.
--
Noriaki TAKAMIYA
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-12-27 5:56 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-05 10:03 [PATCH 2/2] [IPV6] RAW: Add checksum default defines for mobility header Masahide NAKAMURA
2006-12-05 11:02 ` YOSHIFUJI Hideaki / 吉藤英明
2006-12-05 15:04 ` Brian Haley
2006-12-05 15:28 ` YOSHIFUJI Hideaki / 吉藤英明
2006-12-05 21:49 ` David Miller
2006-12-11 6:50 ` David Miller
2006-12-27 2:14 ` YOSHIFUJI Hideaki / 吉藤英明
2006-12-27 4:57 ` Masahide NAKAMURA
2006-12-27 5:44 ` Noriaki TAKAMIYA
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).