From: Brian Haley <brian.haley@hp.com>
To: David Miller <davem@davemloft.net>
Cc: roel.kluin@gmail.com, netdev@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH] ipv6: Keep index within tab_unreach[]
Date: Thu, 18 Jun 2009 00:09:36 -0400 [thread overview]
Message-ID: <4A39BE00.1050506@hp.com> (raw)
In-Reply-To: <20090617.192039.171958637.davem@davemloft.net>
David Miller wrote:
> From: Brian Haley <brian.haley@hp.com>
> Date: Wed, 17 Jun 2009 22:10:08 -0400
>
>> Roel Kluin wrote:
>>> @@ -923,7 +923,7 @@ int icmpv6_err_convert(int type, int code, int *err)
>>> switch (type) {
>>> case ICMPV6_DEST_UNREACH:
>>> fatal = 1;
>>> - if (code <= ICMPV6_PORT_UNREACH) {
>>> + if (code <= ICMPV6_PORT_UNREACH && code >= 0) {
>>> *err = tab_unreach[code].err;
>>> fatal = tab_unreach[code].fatal;
>>> }
>> The code value in the ICMPv6 header is a u8, so should always be positive, right?
>> It doesn't hurt I guess though.
>
> True. Probably best to pass this thing in as a 'u8', rathern than as
> an 'int'.
"type" is a u8 too, but both seem to be passed as int's everywhere (rawv6,
tcp, sctp and dccp), and in the err_handler() func pointer in the inet6_protocol
struct. I can try and cook something up in the next few days that changes
it all to u8's.
-Brian
next prev parent reply other threads:[~2009-06-18 4:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-16 18:40 [PATCH] ipv6: Keep index within tab_unreach[] Roel Kluin
2009-06-18 2:03 ` David Miller
2009-06-18 2:10 ` Brian Haley
2009-06-18 2:20 ` David Miller
2009-06-18 4:09 ` Brian Haley [this message]
2009-06-18 7:26 ` David Miller
2009-06-22 16:20 ` [PATCH] ipv6: Use correct data types for ICMPv6 type and code Brian Haley
2009-06-23 11:31 ` David Miller
2009-07-05 3:46 ` [PATCH] ipv6: Keep index within tab_unreach[] Herbert Xu
2009-07-05 22:52 ` David Miller
2009-07-06 1:03 ` Herbert Xu
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=4A39BE00.1050506@hp.com \
--to=brian.haley@hp.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=roel.kluin@gmail.com \
/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).