]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
[NETFILTER]: nf_queue: don't return error when unregistering a non-existant handler
authorPatrick McHardy <kaber@trash.net>
Mon, 10 Mar 2008 23:45:05 +0000 (16:45 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Mar 2008 23:45:05 +0000 (16:45 -0700)
Commit ce7663d84:

[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>
net/netfilter/nf_queue.c

index bfc2928c19120f4c5994ae616066b1f030ba2a01..ddc80ea114cda13509f5828b2c8f5590a6d7f3e3 100644 (file)
@@ -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;
        }