All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libnfnetlink-1.0.0 iftable.c:nlif_open() has handler unregister error
@ 2010-09-30  6:48 Kuzin Andrey
  2010-09-30 11:28 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Kuzin Andrey @ 2010-09-30  6:48 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 594 bytes --]

struct nlif_handle *nlif_open(void)
{
..........
    if (rtnl_handler_register(h->rtnl_handle, &h->ifadd_handler) < 0)
         goto err_close;
    if (rtnl_handler_register(h->rtnl_handle, &h->ifdel_handler) < 0)
         goto err_unregister;
    return h;
err_unregister:
    rtnl_handler_unregister(h->rtnl_handle, &h->ifdel_handler);
err_close:
    rtnl_close(h->rtnl_handle);
    free(h);
err:
    return NULL;
}


Here if was error after rtnl_handler_register(... ifdel_handler...) need to unregister the ifadd_handler,
but in err_unregister: try to unregister the the ifdel_handler.





[-- Attachment #2: 2.patch --]
[-- Type: application/octet-stream, Size: 372 bytes --]

--- ./a/iftable.c	2009-01-07 04:32:26.000000000 +0300
+++ ./b/iftable.c	2010-09-30 10:35:30.000000000 +0400
@@ -245,7 +245,7 @@ struct nlif_handle *nlif_open(void)
 	return h;
 
 err_unregister:
-	rtnl_handler_unregister(h->rtnl_handle, &h->ifdel_handler);
+	rtnl_handler_unregister(h->rtnl_handle, &h->ifadd_handler);
 err_close:
 	rtnl_close(h->rtnl_handle);
 	free(h);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-30 11:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-30  6:48 [PATCH] libnfnetlink-1.0.0 iftable.c:nlif_open() has handler unregister error Kuzin Andrey
2010-09-30 11:28 ` Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.