diff mbox

[5/5] netfilter: xt_qtaguid: xt_socket: build fixes

Message ID 1446073566-6401-6-git-send-email-john.stultz@linaro.org
State New
Headers show

Commit Message

John Stultz Oct. 28, 2015, 11:06 p.m. UTC
From: Amit Pundir <amit.pundir@linaro.org>


Add missing header <linux/miscdevice.h> 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 <amit.pundir@linaro.org>

[jstultz: Removed static definition for xt_socket_lookup_slow*,
also removed unused variable addition]
Signed-off-by: John Stultz <john.stultz@linaro.org>

---
 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 mbox

Patch

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 <linux/file.h>
 #include <linux/inetdevice.h>
 #include <linux/module.h>
+#include <linux/miscdevice.h>
 #include <linux/netfilter/x_tables.h>
 #include <linux/netfilter/xt_qtaguid.h>
 #include <linux/ratelimit.h>
@@ -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);