From patchwork Thu Jul 31 03:34:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexei Starovoitov X-Patchwork-Id: 375116 X-Patchwork-Delegate: pablo@netfilter.org 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 772D11400E9 for ; Thu, 31 Jul 2014 13:34:33 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932213AbaGaDeb (ORCPT ); Wed, 30 Jul 2014 23:34:31 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:42022 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932188AbaGaDea (ORCPT ); Wed, 30 Jul 2014 23:34:30 -0400 Received: by mail-pd0-f178.google.com with SMTP id w10so2612808pde.23 for ; Wed, 30 Jul 2014 20:34:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Bg9GioJ4kj/vGBVRys96cccnHctPlfk7qEpUaN1nIjo=; b=fYgcthHZBPnrTv3caNiUKUSCxIeR0jM/ZmaW74uO8QAmTIt4Q9s9WJ5MpCw3Enc7z4 JCb0+LBwAfaowdKVcDojh3f1zwl7tcYIGA95fCQH7WLGP4M/bp+6WLmueWT7A0IA5B00 HGCXkV9Upa4ZOQNR22fVs6FkdW19dK4kAvjcAkoxvufQt8h05sphF/UuP77Sf9rKO99f slbbmSrOB6t72Mxw47CyBNGyI/OniKe44BlM2ZO0BlZx1wjQBXLw2+V6XA78KLXFzNLS 6DYtVMUacx6zMXQiHq5RFS0jDfVTfPQk4CweD1P9azYVFz0C/UXyicb0Xmh+rk5w9+wZ VNpQ== X-Gm-Message-State: ALoCoQntfEGr6R+6MLqP9+bPUn1ZbjuOJT5Kn7QWxPcwxkbN+89NLdQPdP/suL4C8GyyJx8JAlst X-Received: by 10.68.69.69 with SMTP id c5mr129972pbu.155.1406777670013; Wed, 30 Jul 2014 20:34:30 -0700 (PDT) Received: from pg-vmw-gw1.plumgrid.com ([67.21.3.149]) by mx.google.com with ESMTPSA id y2sm14198124pas.45.2014.07.30.20.34.28 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Jul 2014 20:34:29 -0700 (PDT) From: Alexei Starovoitov To: "David S. Miller" Cc: Daniel Borkmann , Willem de Bruijn , Pablo Neira Ayuso , Kees Cook , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org Subject: [PATCH v4 net-next 2/5] net: filter: rename sk_filter_proglen -> bpf_classic_proglen Date: Wed, 30 Jul 2014 20:34:13 -0700 Message-Id: <1406777656-27755-3-git-send-email-ast@plumgrid.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1406777656-27755-1-git-send-email-ast@plumgrid.com> References: <1406777656-27755-1-git-send-email-ast@plumgrid.com> Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org trivial rename to better match semantics of macro Signed-off-by: Alexei Starovoitov --- include/linux/filter.h | 3 +-- net/core/filter.c | 8 ++++---- net/core/sock_diag.c | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/linux/filter.h b/include/linux/filter.h index 00640edc166f..3769341a745d 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -344,8 +344,7 @@ static inline unsigned int sk_filter_size(unsigned int proglen) offsetof(struct sk_filter, insns[proglen])); } -#define sk_filter_proglen(fprog) \ - (fprog->len * sizeof(fprog->filter[0])) +#define bpf_classic_proglen(fprog) (fprog->len * sizeof(fprog->filter[0])) int sk_filter(struct sock *sk, struct sk_buff *skb); diff --git a/net/core/filter.c b/net/core/filter.c index 5a6aeb1d40b8..d6cb287e4f59 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -813,7 +813,7 @@ EXPORT_SYMBOL(sk_chk_filter); static int sk_store_orig_filter(struct sk_filter *fp, const struct sock_fprog *fprog) { - unsigned int fsize = sk_filter_proglen(fprog); + unsigned int fsize = bpf_classic_proglen(fprog); struct sock_fprog_kern *fkprog; fp->orig_prog = kmalloc(sizeof(*fkprog), GFP_KERNEL); @@ -1001,7 +1001,7 @@ static struct sk_filter *__sk_prepare_filter(struct sk_filter *fp) int sk_unattached_filter_create(struct sk_filter **pfp, struct sock_fprog_kern *fprog) { - unsigned int fsize = sk_filter_proglen(fprog); + unsigned int fsize = bpf_classic_proglen(fprog); struct sk_filter *fp; /* Make sure new filter is there and in the right amounts. */ @@ -1053,7 +1053,7 @@ EXPORT_SYMBOL_GPL(sk_unattached_filter_destroy); int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) { struct sk_filter *fp, *old_fp; - unsigned int fsize = sk_filter_proglen(fprog); + unsigned int fsize = bpf_classic_proglen(fprog); unsigned int sk_fsize = sk_filter_size(fprog->len); int err; @@ -1154,7 +1154,7 @@ int sk_get_filter(struct sock *sk, struct sock_filter __user *ubuf, goto out; ret = -EFAULT; - if (copy_to_user(ubuf, fprog->filter, sk_filter_proglen(fprog))) + if (copy_to_user(ubuf, fprog->filter, bpf_classic_proglen(fprog))) goto out; /* Instead of bytes, the API requests to return the number diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c index a4216a4c9572..57d922320c59 100644 --- a/net/core/sock_diag.c +++ b/net/core/sock_diag.c @@ -69,7 +69,7 @@ int sock_diag_put_filterinfo(bool may_report_filterinfo, struct sock *sk, goto out; fprog = filter->orig_prog; - flen = sk_filter_proglen(fprog); + flen = bpf_classic_proglen(fprog); attr = nla_reserve(skb, attrtype, flen); if (attr == NULL) {