From patchwork Wed Oct 28 23:06:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 55737 Delivered-To: patches@linaro.org Received: by 10.112.61.134 with SMTP id p6csp218032lbr; Wed, 28 Oct 2015 16:06:47 -0700 (PDT) X-Received: by 10.68.182.161 with SMTP id ef1mr37280687pbc.79.1446073607129; Wed, 28 Oct 2015 16:06:47 -0700 (PDT) Return-Path: Received: from mail-pa0-x233.google.com (mail-pa0-x233.google.com. [2607:f8b0:400e:c03::233]) by mx.google.com with ESMTPS id rf7si73509644pab.149.2015.10.28.16.06.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Oct 2015 16:06:47 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c03::233 as permitted sender) client-ip=2607:f8b0:400e:c03::233; Authentication-Results: mx.google.com; spf=pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c03::233 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dkim=pass header.i=@linaro_org.20150623.gappssmtp.com Received: by pacfv9 with SMTP id fv9so20764075pac.3 for ; Wed, 28 Oct 2015 16:06:46 -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=oA+RTTKEDgv5aT6e2fuZdLJmBvoR1YUtgPCCUEYg1/c=; b=KN//FgZ6qXsxgVwvfyXmfMjHnhupq0Zccp83CRtncRe/23eO3HflrK1HW/zoinSnrW qJfCnJb+kHp+16BYVGoPvHY8PpbDi+zTlZsXGW3l9b6J+OVCP+SRjKMHiutyoZt59QSt ydRcr3xDOi2R7PEwbJmEkQdQVBSNA5H3tWUzHDGzWAKG+wtmw8bq3+AWQTgY7d5WuKmp /ymAu6I6Or9hJei+7NmC9WAbBacsujPYerM1jylyUh6U9pJ9Kqt+2MJXUQtSb2JthU3A ptXg7IYtjZqR4IvL1eOX4+uaXnzMl9V1wKJ592uLlH/hg1t5kPytKQqXr57RtTSQxHek qLpQ== 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=oA+RTTKEDgv5aT6e2fuZdLJmBvoR1YUtgPCCUEYg1/c=; b=ZgJNraRxZ2sRxqF11q4UBswhuT+vZHJI2n2nSiqFJQ3kvI2KAa3wFKQTiSxApzb39h UhCnOfxYEuYBCVovEwzMceh0wHWFt+eMwROITdIrJ5JPpwcMnW3wXy8N10r+0f1ePTgg IIvBjCiw6t2ldYqKrZvwtuO2GifkHzw0jgmoqTHBETJsT48nvN4tNTtEZZ5T6iErIw4u fz23Gl5xZlbu7pf/XEqfRjpRSxBk8D67CWp7xkExUZ/12U795MELTTv/u6KEGcGCk+UY ijToUg/QlpVOJBYYAmZyFrEXuSwa4565A/OXYE/6y39M8BhE4K0DskZrDCIlEUVHioOD jveg== X-Gm-Message-State: ALoCoQnTzkZ5LOO3GRNRxzPCsl9yywinKHVvxPzI3NQRiYXmmjv6OpQzQLNJL5FfBRSKnrPAZQ5D X-Received: by 10.68.178.1 with SMTP id cu1mr36139164pbc.99.1446073606783; Wed, 28 Oct 2015 16:06:46 -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.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Oct 2015 16:06:46 -0700 (PDT) From: John Stultz To: Dmitry Shmidt Cc: Amit Pundir , John Stultz Subject: [PATCH 5/5] netfilter: xt_qtaguid: xt_socket: build fixes Date: Wed, 28 Oct 2015 16:06:06 -0700 Message-Id: <1446073566-6401-6-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 Add missing header and use xt_socket_lookup_slow_v* instead of xt_socket_get*_sk in xt_qtaguid.c. Fix xt_socket_lookup_slow_v* functions in xt_socket.c and declare them in xt_socket.h Signed-off-by: Amit Pundir [jstultz: Removed static definition for xt_socket_lookup_slow*, also removed unused variable addition] Signed-off-by: John Stultz --- include/uapi/linux/netfilter/xt_socket.h | 8 ++++---- net/netfilter/xt_qtaguid.c | 5 +++-- net/netfilter/xt_socket.c | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) -- 1.9.1 diff --git a/include/uapi/linux/netfilter/xt_socket.h b/include/uapi/linux/netfilter/xt_socket.h index 55076a3..2565a20 100644 --- a/include/uapi/linux/netfilter/xt_socket.h +++ b/include/uapi/linux/netfilter/xt_socket.h @@ -18,9 +18,9 @@ struct xt_socket_mtinfo2 { }; #define XT_SOCKET_FLAGS_V2 (XT_SOCKET_TRANSPARENT | XT_SOCKET_NOWILDCARD) -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, - struct xt_action_param *par); +struct sock *xt_socket_lookup_slow_v4(const struct sk_buff *skb, + const struct net_device *indev); +struct sock *xt_socket_lookup_slow_v6(const struct sk_buff *skb, + const struct net_device *indev); #endif /* _XT_SOCKET_H */ diff --git a/net/netfilter/xt_qtaguid.c b/net/netfilter/xt_qtaguid.c index 2f9784c..90b2c6a 100644 --- a/net/netfilter/xt_qtaguid.c +++ b/net/netfilter/xt_qtaguid.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -1588,10 +1589,10 @@ static struct sock *qtaguid_find_sk(const struct sk_buff *skb, switch (par->family) { case NFPROTO_IPV6: - sk = xt_socket_get6_sk(skb, par); + sk = xt_socket_lookup_slow_v6(skb, par->in); break; case NFPROTO_IPV4: - sk = xt_socket_get4_sk(skb, par); + sk = xt_socket_lookup_slow_v4(skb, par->in); break; default: return NULL; diff --git a/net/netfilter/xt_socket.c b/net/netfilter/xt_socket.c index 75aa4f2..52d5f6d 100644 --- a/net/netfilter/xt_socket.c +++ b/net/netfilter/xt_socket.c @@ -143,7 +143,7 @@ static bool xt_socket_sk_is_transparent(struct sock *sk) } } -static struct sock *xt_socket_lookup_slow_v4(const struct sk_buff *skb, +struct sock *xt_socket_lookup_slow_v4(const struct sk_buff *skb, const struct net_device *indev) { const struct iphdr *iph = ip_hdr(skb); @@ -330,7 +330,7 @@ xt_socket_get_sock_v6(struct net *net, const u8 protocol, return NULL; } -static struct sock *xt_socket_lookup_slow_v6(const struct sk_buff *skb, +struct sock *xt_socket_lookup_slow_v6(const struct sk_buff *skb, const struct net_device *indev) { __be16 uninitialized_var(dport), uninitialized_var(sport);