netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: Keep index within tab_unreach[]
@ 2009-06-16 18:40 Roel Kluin
  2009-06-18  2:03 ` David Miller
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Roel Kluin @ 2009-06-16 18:40 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Andrew Morton

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-07-06  1:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).