]> err.no Git - linux-2.6/blobdiff - net/netfilter/nfnetlink.c
Merge branch 'tracing/ftrace' into auto-ftrace-next
[linux-2.6] / net / netfilter / nfnetlink.c
index cb41990f92e0d9fbd5f97e80f5353e6ca6c81dd2..b75c9c4a995d885c1ac12339b0afff9d1d24db31 100644 (file)
@@ -44,26 +44,14 @@ static struct sock *nfnl = NULL;
 static const struct nfnetlink_subsystem *subsys_table[NFNL_SUBSYS_COUNT];
 static DEFINE_MUTEX(nfnl_mutex);
 
-static void nfnl_lock(void)
+static inline void nfnl_lock(void)
 {
        mutex_lock(&nfnl_mutex);
 }
 
-static int nfnl_trylock(void)
-{
-       return !mutex_trylock(&nfnl_mutex);
-}
-
-static void __nfnl_unlock(void)
-{
-       mutex_unlock(&nfnl_mutex);
-}
-
-static void nfnl_unlock(void)
+static inline void nfnl_unlock(void)
 {
        mutex_unlock(&nfnl_mutex);
-       if (nfnl->sk_receive_queue.qlen)
-               nfnl->sk_data_ready(nfnl, 0);
 }
 
 int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n)
@@ -147,9 +135,7 @@ static int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
        ss = nfnetlink_get_subsys(type);
        if (!ss) {
 #ifdef CONFIG_KMOD
-               /* don't call nfnl_unlock, since it would reenter
-                * with further packet processing */
-               __nfnl_unlock();
+               nfnl_unlock();
                request_module("nfnetlink-subsys-%d", NFNL_SUBSYS_ID(type));
                nfnl_lock();
                ss = nfnetlink_get_subsys(type);
@@ -183,22 +169,17 @@ static int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
        }
 }
 
-static void nfnetlink_rcv(struct sock *sk, int len)
+static void nfnetlink_rcv(struct sk_buff *skb)
 {
-       unsigned int qlen = 0;
-
-       do {
-               if (nfnl_trylock())
-                       return;
-               qlen = netlink_run_queue(sk, qlen, nfnetlink_rcv_msg);
-               __nfnl_unlock();
-       } while (qlen);
+       nfnl_lock();
+       netlink_rcv_skb(skb, &nfnetlink_rcv_msg);
+       nfnl_unlock();
 }
 
 static void __exit nfnetlink_exit(void)
 {
        printk("Removing netfilter NETLINK layer.\n");
-       sock_release(nfnl->sk_socket);
+       netlink_kernel_release(nfnl);
        return;
 }