From: Konstantin Khlebnikov Date: Wed, 15 May 2019 11:40:52 +0000 (+0300) Subject: net: bpfilter: fallback to netfilter if failed to load bpfilter kernel module X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=752beb5ec4413d40434957e427c6c48d5043f805;p=openwrt%2Fstaging%2Fblogic.git net: bpfilter: fallback to netfilter if failed to load bpfilter kernel module If bpfilter is not available return ENOPROTOOPT to fallback to netfilter. Function request_module() returns both errors and userspace exit codes. Just ignore them. Rechecking bpfilter_ops is enough. Fixes: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module") Signed-off-by: Konstantin Khlebnikov Signed-off-by: David S. Miller --- diff --git a/net/ipv4/bpfilter/sockopt.c b/net/ipv4/bpfilter/sockopt.c index 15427163a041..0480918bfc7c 100644 --- a/net/ipv4/bpfilter/sockopt.c +++ b/net/ipv4/bpfilter/sockopt.c @@ -30,13 +30,11 @@ static int bpfilter_mbox_request(struct sock *sk, int optname, mutex_lock(&bpfilter_ops.lock); if (!bpfilter_ops.sockopt) { mutex_unlock(&bpfilter_ops.lock); - err = request_module("bpfilter"); + request_module("bpfilter"); mutex_lock(&bpfilter_ops.lock); - if (err) - goto out; if (!bpfilter_ops.sockopt) { - err = -ECHILD; + err = -ENOPROTOOPT; goto out; } }