提交 94be1a3f 编写于 作者: P Patrick McHardy 提交者: David S. Miller

[NETFILTER]: nf_queue: don't return error when unregistering a non-existant handler

Commit ce7663d8:

[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: NPatrick McHardy <kaber@trash.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 914afea8
...@@ -51,7 +51,7 @@ int nf_unregister_queue_handler(int pf, const struct nf_queue_handler *qh) ...@@ -51,7 +51,7 @@ int nf_unregister_queue_handler(int pf, const struct nf_queue_handler *qh)
return -EINVAL; return -EINVAL;
mutex_lock(&queue_handler_mutex); mutex_lock(&queue_handler_mutex);
if (queue_handler[pf] != qh) { if (queue_handler[pf] && queue_handler[pf] != qh) {
mutex_unlock(&queue_handler_mutex); mutex_unlock(&queue_handler_mutex);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册