netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] ipv6: Keep index within tab_unreach[]
Date: Tue, 16 Jun 2009 20:40:21 +0200	[thread overview]
Message-ID: <4A37E715.4060504@gmail.com> (raw)

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;
 		}

             reply	other threads:[~2009-06-16 16:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-16 18:40 Roel Kluin [this message]
2009-06-18  2:03 ` [PATCH] ipv6: Keep index within tab_unreach[] David Miller
2009-06-18  2:10 ` Brian Haley
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=4A37E715.4060504@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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).