netfilter: nfnetlink: don't probe module if it exists
authorFlorian Westphal <fw@strlen.de>
Tue, 27 Oct 2015 12:20:25 +0000 (13:20 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 28 Oct 2015 02:40:50 +0000 (03:40 +0100)
nfnetlink_bind request_module()s all the time as nfnetlink_get_subsys()
shifts the argument by 8 to obtain the subsys id.

So using type instead of type << 8 always returns NULL.

Fixes: 03292745b02d11 ("netlink: add nlk->netlink_bind hook for module auto-loading")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nfnetlink.c

index 70277b11f742e8f0a2756c2ba54e1565419adc95..27b93daee61f63cbceb093192daa9b460b6fcef6 100644 (file)
@@ -492,7 +492,7 @@ static int nfnetlink_bind(struct net *net, int group)
        type = nfnl_group2type[group];
 
        rcu_read_lock();
-       ss = nfnetlink_get_subsys(type);
+       ss = nfnetlink_get_subsys(type << 8);
        rcu_read_unlock();
        if (!ss)
                request_module("nfnetlink-subsys-%d", type);