All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Haley <brian.haley@hp.com>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] ipv6: Keep index within tab_unreach[]
Date: Wed, 17 Jun 2009 22:10:08 -0400	[thread overview]
Message-ID: <4A39A200.20603@hp.com> (raw)
In-Reply-To: <4A37E715.4060504@gmail.com>

Roel Kluin wrote:
> Ensure that index `code' remains within array tab_unreach[]
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.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

  parent reply	other threads:[~2009-06-18  2: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 [this message]
2009-06-18  2:20   ` David Miller
2009-06-18  4:09     ` Brian Haley
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=4A39A200.20603@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.