From patchwork Mon Sep 3 21:16:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Dangaard Brouer X-Patchwork-Id: 181417 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 7FCDA2C008D for ; Tue, 4 Sep 2012 07:12:41 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753760Ab2ICVMj (ORCPT ); Mon, 3 Sep 2012 17:12:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18916 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753456Ab2ICVMj (ORCPT ); Mon, 3 Sep 2012 17:12:39 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q83LCVgx026860 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 3 Sep 2012 17:12:31 -0400 Received: from dragon.localdomain (ovpn-116-72.ams2.redhat.com [10.36.116.72]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q83LCVA8030563; Mon, 3 Sep 2012 17:12:31 -0400 Received: from [127.0.0.1] (localhost [IPv6:::1]) by dragon.localdomain (Postfix) with ESMTP id 6FC192C1774; Mon, 3 Sep 2012 23:16:47 +0200 (CEST) From: Jesper Dangaard Brouer Subject: [RFC PATCH 2/2] netfilter: More users of ipv6_find_hdr_cb() To: "Patrick McHardy" , Hans Schillstrom , Hans Schillstrom Cc: Jesper Dangaard Brouer , netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, Pablo Neira Ayuso Date: Mon, 03 Sep 2012 23:16:47 +0200 Message-ID: <20120903211631.8851.40213.stgit@dragon> In-Reply-To: <20120903211504.8851.6894.stgit@dragon> References: <20120903211504.8851.6894.stgit@dragon> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Functions tproxy_tg6_v1() and socket_mt6_v1 could use the CB cached version of ipv6_find_hdr(). Signed-off-by: Jesper Dangaard Brouer --- Could someone with tproxy or socket experience tell me, if the SKB CB data can survive this far? net/netfilter/xt_TPROXY.c | 2 +- net/netfilter/xt_socket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" 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/netfilter/xt_TPROXY.c b/net/netfilter/xt_TPROXY.c index d7f1953..c73b713 100644 --- a/net/netfilter/xt_TPROXY.c +++ b/net/netfilter/xt_TPROXY.c @@ -285,7 +285,7 @@ tproxy_tg6_v1(struct sk_buff *skb, const struct xt_action_param *par) int thoff = 0; int tproto; - tproto = ipv6_find_hdr(skb, &thoff, -1, NULL, NULL); + tproto = ipv6_find_hdr_cb(skb, &thoff, -1, NULL, NULL); if (tproto < 0) { pr_debug("unable to find transport header in IPv6 packet, dropping\n"); return NF_DROP; diff --git a/net/netfilter/xt_socket.c b/net/netfilter/xt_socket.c index 9ea482d..4feca50 100644 --- a/net/netfilter/xt_socket.c +++ b/net/netfilter/xt_socket.c @@ -266,7 +266,7 @@ socket_mt6_v1(const struct sk_buff *skb, struct xt_action_param *par) int thoff = 0, tproto; const struct xt_socket_mtinfo1 *info = (struct xt_socket_mtinfo1 *) par->matchinfo; - tproto = ipv6_find_hdr(skb, &thoff, -1, NULL, NULL); + tproto = ipv6_find_hdr_cb(skb, &thoff, -1, NULL, NULL); if (tproto < 0) { pr_debug("unable to find transport header in IPv6 packet, dropping\n"); return NF_DROP;