From patchwork Wed Oct 28 23:06:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 55736 Delivered-To: patches@linaro.org Received: by 10.112.61.134 with SMTP id p6csp218018lbr; Wed, 28 Oct 2015 16:06:44 -0700 (PDT) X-Received: by 10.66.162.232 with SMTP id yd8mr36551805pab.55.1446073604542; Wed, 28 Oct 2015 16:06:44 -0700 (PDT) Return-Path: Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com. [2607:f8b0:400e:c03::22c]) by mx.google.com with ESMTPS id uj9si27227556pab.128.2015.10.28.16.06.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Oct 2015 16:06:44 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c03::22c as permitted sender) client-ip=2607:f8b0:400e:c03::22c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c03::22c as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dkim=pass header.i=@linaro_org.20150623.gappssmtp.com Received: by padhk11 with SMTP id hk11so19963119pad.1 for ; Wed, 28 Oct 2015 16:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1IWzAZlUf31cxXf3wSy6+u2/iyNi4axj2pHk+Vmh3DE=; b=1uL6og+WoFL2hJDkx6mrh5vasTG7Us4vSRnh+yg/VrEhACyiYEzZaipdzmMUAxtp7s qH2fRQmZe9ViiAEd6Y0zC56p4L63jRFYNCfXSL+9TpVmSOwES3C4UWJMqt/4m1cmcPou y/zdegAWHFP4GrUWoqiSFpefZYQzjRBK46KqDZMh7HKs9NBSNYLyBYqkOfTJzp4sHGUR Av4amfPkPeJELD2+inrjQMGBNWdbKNCMlVI/XfT4xwDNlAHQJ3XirZBxTfqfLV91vRdy FtqqyKSFpQTy9eB0Hw0Kz9Ov9vtXIsz2Hm9ubDajq3waFj2cDgjTD3S9hssSQBeHWn9T kITQ== 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=1IWzAZlUf31cxXf3wSy6+u2/iyNi4axj2pHk+Vmh3DE=; b=IKFzoBg7GrIkUbtkClPzsa9gAdTF9Kc3h7iP65SINgsrijXPKyrg/gKCSCc8aaQHBR Q8+blSJ7J3Zo1BUuCIaePNCSn3+3zFavXE4B647GVg/4rHTZGebQ7RL08bRA0BrU/OS9 C2XjcpMSKtbZMWJhSAdXzBeR29ZRMIV4qia/TgnqowjdnixRAAegRrD5GufIuyOTz5S7 GPed/3gXhvWce67xVw+oYVtX61bnn3qobxgXGVIAwN7bS2wN2F/ZZSHMnacC0/ZfziHV WN7nwVjJCG3tHdOM3/2OrTp8yyy+1a+HXuizMXvEGaQ/2ziGArlQtGocM/gwXubRsqax xxJg== X-Gm-Message-State: ALoCoQlca+Lf/Kp43x2G5BIUwsQRmw1McaGu7cU/Uz4s3ewiCv6ZRicfLwkNBRE5t192z7wUwUjL X-Received: by 10.68.213.39 with SMTP id np7mr37055178pbc.165.1446073604192; Wed, 28 Oct 2015 16:06:44 -0700 (PDT) Return-Path: Received: from localhost.localdomain (c-76-115-103-22.hsd1.or.comcast.net. [76.115.103.22]) by smtp.gmail.com with ESMTPSA id by6sm42851961pab.25.2015.10.28.16.06.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Oct 2015 16:06:43 -0700 (PDT) From: John Stultz To: Dmitry Shmidt Cc: Amit Pundir , John Stultz Subject: [PATCH 4/5] xt_qtaguid: use sock_gen_put() instead of xt_socket_put_sk() Date: Wed, 28 Oct 2015 16:06:05 -0700 Message-Id: <1446073566-6401-5-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1446073566-6401-1-git-send-email-john.stultz@linaro.org> References: <1446073566-6401-1-git-send-email-john.stultz@linaro.org> From: Amit Pundir Removing obsolete xt_socket_put_sk() and using sock_gen_put() instead. xt_socket_put_sk() was reintroduced for xt_qtaguid in one of the patches, but it turned out sock_gen_put() supersedes xt_socket_put_sk(). So we don't need xt_socket_put_sk() any more. This patch is based on commit 1a8bf6eeef9f (netfilter: xt_socket: use sock_gen_put()) Signed-off-by: Amit Pundir Change-Id: I976d5f7f7eded0f3cc91b596acfeb35e4c2057e5 (cherry picked from commit 551780fc28cb7480dbc4f585ef80ca02c2922ec1) [jstultz: Cherry-picked from Amit's tree] Signed-off-by: John Stultz --- include/uapi/linux/netfilter/xt_socket.h | 1 - net/netfilter/xt_qtaguid.c | 4 ++-- net/netfilter/xt_socket.c | 10 ---------- 3 files changed, 2 insertions(+), 13 deletions(-) -- 1.9.1 diff --git a/include/uapi/linux/netfilter/xt_socket.h b/include/uapi/linux/netfilter/xt_socket.h index c9b247c..55076a3 100644 --- a/include/uapi/linux/netfilter/xt_socket.h +++ b/include/uapi/linux/netfilter/xt_socket.h @@ -18,7 +18,6 @@ struct xt_socket_mtinfo2 { }; #define XT_SOCKET_FLAGS_V2 (XT_SOCKET_TRANSPARENT | XT_SOCKET_NOWILDCARD) -void xt_socket_put_sk(struct sock *sk); struct sock *xt_socket_get4_sk(const struct sk_buff *skb, struct xt_action_param *par); struct sock *xt_socket_get6_sk(const struct sk_buff *skb, diff --git a/net/netfilter/xt_qtaguid.c b/net/netfilter/xt_qtaguid.c index e33be3a..2f9784c 100644 --- a/net/netfilter/xt_qtaguid.c +++ b/net/netfilter/xt_qtaguid.c @@ -1605,7 +1605,7 @@ static struct sock *qtaguid_find_sk(const struct sk_buff *skb, * "struct inet_timewait_sock" which is missing fields. */ if (sk->sk_state == TCP_TIME_WAIT) { - xt_socket_put_sk(sk); + sock_gen_put(sk); sk = NULL; } } @@ -1803,7 +1803,7 @@ static bool qtaguid_mt(const struct sk_buff *skb, struct xt_action_param *par) put_sock_ret_res: if (got_sock) - xt_socket_put_sk(sk); + sock_gen_put(sk); if (set_sk_callback_lock) read_unlock_bh(&sk->sk_callback_lock); ret_res: diff --git a/net/netfilter/xt_socket.c b/net/netfilter/xt_socket.c index 0a6afb4..75aa4f2 100644 --- a/net/netfilter/xt_socket.c +++ b/net/netfilter/xt_socket.c @@ -35,16 +35,6 @@ #include #endif -void -xt_socket_put_sk(struct sock *sk) -{ - if (sk->sk_state == TCP_TIME_WAIT) - inet_twsk_put(inet_twsk(sk)); - else - sock_put(sk); -} -EXPORT_SYMBOL(xt_socket_put_sk); - static int extract_icmp4_fields(const struct sk_buff *skb, u8 *protocol,