]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/core/sock_diag.c
sock_diag: Fix module netlink aliases
[mv-sheeva.git] / net / core / sock_diag.c
index fbaf01ce12f21def454a91a3098a9dafecc384cb..cee96f3681085922c0b776a1f85b94ace36d7c12 100644 (file)
@@ -32,7 +32,7 @@ int sock_diag_register(struct sock_diag_handler *hndl)
 {
        int err = 0;
 
-       if (hndl->family > AF_MAX)
+       if (hndl->family >= AF_MAX)
                return -EINVAL;
 
        mutex_lock(&sock_diag_table_mutex);
@@ -50,7 +50,7 @@ void sock_diag_unregister(struct sock_diag_handler *hnld)
 {
        int family = hnld->family;
 
-       if (family > AF_MAX)
+       if (family >= AF_MAX)
                return;
 
        mutex_lock(&sock_diag_table_mutex);
@@ -64,7 +64,7 @@ static inline struct sock_diag_handler *sock_diag_lock_handler(int family)
 {
        if (sock_diag_handlers[family] == NULL)
                request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK,
-                               NETLINK_SOCK_DIAG, IPPROTO_IP);
+                               NETLINK_SOCK_DIAG, family);
 
        mutex_lock(&sock_diag_table_mutex);
        return sock_diag_handlers[family];
@@ -103,7 +103,7 @@ static int sock_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
        case DCCPDIAG_GETSOCK:
                if (inet_rcv_compat == NULL)
                        request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK,
-                                       NETLINK_SOCK_DIAG, IPPROTO_IP);
+                                       NETLINK_SOCK_DIAG, AF_INET);
 
                mutex_lock(&sock_diag_table_mutex);
                if (inet_rcv_compat != NULL)