From patchwork Wed Nov 20 19:25:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Moore X-Patchwork-Id: 292848 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8393C2C0096 for ; Thu, 21 Nov 2013 06:25:55 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754710Ab3KTTZw (ORCPT ); Wed, 20 Nov 2013 14:25:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31429 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754193Ab3KTTZv (ORCPT ); Wed, 20 Nov 2013 14:25:51 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAKJPoCC027593 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Nov 2013 14:25:50 -0500 Received: from [127.0.0.1] (vpn-58-203.rdu2.redhat.com [10.10.58.203]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rAKJPnGd003291; Wed, 20 Nov 2013 14:25:49 -0500 Subject: [PATCH] cipso: simplify cipso_v4_translate() when !CONFIG_NETLABEL To: netdev@vger.kernel.org From: Paul Moore Date: Wed, 20 Nov 2013 14:25:48 -0500 Message-ID: <20131120192548.5616.74526.stgit@localhost> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Previous commits corrected some problems with cipso_v4_translate() when CONFIG_NETLABEL=n but some additional work is needed to tidy things up a bit. Signed-off-by: Paul Moore --- include/net/cipso_ipv4.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 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/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h index a8c2ef6..2244e02 100644 --- a/include/net/cipso_ipv4.h +++ b/include/net/cipso_ipv4.h @@ -304,7 +304,7 @@ static inline int cipso_v4_validate(const struct sk_buff *skb, for (opt_iter = 6; opt_iter < opt_len;) { tag_len = opt[opt_iter + 1]; - if ((tag_len == 0) || (opt[opt_iter + 1] > (opt_len - opt_iter))) { + if ((tag_len == 0) || (tag_len > (opt_len - opt_iter))) { err_offset = opt_iter + 1; goto out; }