[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A39A200.20603@hp.com>
Date: Wed, 17 Jun 2009 22:10:08 -0400
From: Brian Haley <brian.haley@...com>
To: Roel Kluin <roel.kluin@...il.com>
CC: "David S. Miller" <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] ipv6: Keep index within tab_unreach[]
Roel Kluin 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) {
> *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.
-Brian
--
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