]> err.no Git - linux-2.6/blobdiff - net/ipv4/inet_diag.c
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[linux-2.6] / net / ipv4 / inet_diag.c
index b04a6ee5a9a118c313bbc450922597cc857f20b6..dc429b6b0ba62bbca65f545f6a9a8630e02eaafa 100644 (file)
@@ -815,6 +815,12 @@ static int inet_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
            nlmsg_len(nlh) < hdrlen)
                return -EINVAL;
 
+#ifdef CONFIG_KMOD
+       if (inet_diag_table[nlh->nlmsg_type] == NULL)
+               request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK,
+                              NETLINK_INET_DIAG, nlh->nlmsg_type);
+#endif
+
        if (inet_diag_table[nlh->nlmsg_type] == NULL)
                return -ENOENT;
 
@@ -839,15 +845,11 @@ static int inet_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
 
 static DEFINE_MUTEX(inet_diag_mutex);
 
-static void inet_diag_rcv(struct sock *sk, int len)
+static void inet_diag_rcv(struct sk_buff *skb)
 {
-       unsigned int qlen = 0;
-
-       do {
-               mutex_lock(&inet_diag_mutex);
-               qlen = netlink_run_queue(sk, qlen, &inet_diag_rcv_msg);
-               mutex_unlock(&inet_diag_mutex);
-       } while (qlen);
+       mutex_lock(&inet_diag_mutex);
+       netlink_rcv_skb(skb, &inet_diag_rcv_msg);
+       mutex_unlock(&inet_diag_mutex);
 }
 
 static DEFINE_SPINLOCK(inet_diag_register_lock);
@@ -918,3 +920,4 @@ static void __exit inet_diag_exit(void)
 module_init(inet_diag_init);
 module_exit(inet_diag_exit);
 MODULE_LICENSE("GPL");
+MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_INET_DIAG);