Skip to content

Commit

Permalink
[NETFILTER]: nf_queue: don't return error when unregistering a non-ex…
Browse files Browse the repository at this point in the history
…istant handler

Commit ce7663d:

[NETFILTER]: nfnetlink_queue: don't unregister handler of other subsystem

changed nf_unregister_queue_handler to return an error when attempting to
unregister a queue handler that is not identical to the one passed in.
This is correct in case we really do have a different queue handler already
registered, but some existing userspace code always does an unbind before
bind and aborts if that fails, so try to be nice and return success in
that case.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Mar 10, 2008
1 parent 914afea commit 94be1a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nf_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int nf_unregister_queue_handler(int pf, const struct nf_queue_handler *qh)
return -EINVAL;

mutex_lock(&queue_handler_mutex);
if (queue_handler[pf] != qh) {
if (queue_handler[pf] && queue_handler[pf] != qh) {
mutex_unlock(&queue_handler_mutex);
return -EINVAL;
}
Expand Down

0 comments on commit 94be1a3

Please sign in to comment.