Skip to content

Commit

Permalink
net: bpfilter: fallback to netfilter if failed to load bpfilter kerne…
Browse files Browse the repository at this point in the history
…l 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: d2ba09c ("net: add skeleton of bpfilter kernel module")
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Konstantin Khlebnikov authored and David S. Miller committed May 16, 2019
1 parent a9eeb99 commit 752beb5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/ipv4/bpfilter/sockopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 752beb5

Please sign in to comment.