[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090705.155215.20761447.davem@davemloft.net>
Date: Sun, 05 Jul 2009 15:52:15 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: herbert@...dor.apana.org.au
Cc: roel.kluin@...il.com, netdev@...r.kernel.org,
akpm@...ux-foundation.org
Subject: Re: [PATCH] ipv6: Keep index within tab_unreach[]
From: Herbert Xu <herbert@...dor.apana.org.au>
Date: Sun, 5 Jul 2009 11:46:55 +0800
> Roel Kluin <roel.kluin@...il.com> wrote:
>> Ensure that index `code' remains within array tab_unreach[]
>>
>> Signed-off-by: Roel Kluin <roel.kluin@...il.com>
>> ---
>> diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
>> index 36dff88..8f850de 100644
>> --- a/net/ipv6/icmp.c
>> +++ b/net/ipv6/icmp.c
>> @@ -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) {
>
> Why not make code unsigned?
type and code should both be "u8"'s, we made a similar
conversio of a family of ipv6 function arguments recently.
Actually, it's already there and done to this very function.
Herbert, this is just an ancient patch that has been superceded
by the very change you are suggestions :-)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists