From patchwork Tue Jun 16 18:40:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 28735 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 254E5B7192 for ; Wed, 17 Jun 2009 02:40:29 +1000 (EST) Received: by ozlabs.org (Postfix) id 18676DDD0B; Wed, 17 Jun 2009 02:40:29 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id AAA02DDD04 for ; Wed, 17 Jun 2009 02:40:28 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757025AbZFPQkT (ORCPT ); Tue, 16 Jun 2009 12:40:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756195AbZFPQkS (ORCPT ); Tue, 16 Jun 2009 12:40:18 -0400 Received: from mail-bw0-f213.google.com ([209.85.218.213]:45611 "EHLO mail-bw0-f213.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754843AbZFPQkQ (ORCPT ); Tue, 16 Jun 2009 12:40:16 -0400 Received: by bwz9 with SMTP id 9so4198615bwz.37 for ; Tue, 16 Jun 2009 09:40:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=+V7SJcrjwPCMoKlmlcRsTs0rJgA+ed3TGWeS2pU6klY=; b=ZURHzQRbl8SsOHAsEevc42+iiCLJQ62BIPNxW8UohWKl15qr1CxSc9CyAxKscJE1mN phXhx5sbLRjsRSHWr8QC45Cpr6UUqYxQFCVbI9FHZ9h/hveF9LB7Enru7ZsSag0Q+PPe 5znPvpCPuCtjTQOeyFMWQbk1upiWLXAw18UnM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=vAhhSDzkAVbZosmYqlvg4pZnWOK/0aj6mYefea9oCmJjDFUgNkgPtCkVT7cfSIAkXh UqMAqkpKGGf7xsBI3Z+FlqlMUB5SnDaxgZN+OxzY2EAVXIRQSRXs+wCuzcQ2Eq9YOFVB 3QhsNeGP/Q6tvrZQZnnU1XddDgVOMbR/fyZV0= Received: by 10.216.55.208 with SMTP id k58mr2900049wec.9.1245170417942; Tue, 16 Jun 2009 09:40:17 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 24sm37469eyx.3.2009.06.16.09.40.17 (version=SSLv3 cipher=RC4-MD5); Tue, 16 Jun 2009 09:40:17 -0700 (PDT) Message-ID: <4A37E715.4060504@gmail.com> Date: Tue, 16 Jun 2009 20:40:21 +0200 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: "David S. Miller" CC: netdev , Andrew Morton Subject: [PATCH] ipv6: Keep index within tab_unreach[] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Ensure that index `code' remains within array tab_unreach[] Signed-off-by: Roel Kluin --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }