tags 684863 + pending thanks Dear maintainer,
I've prepared an NMU for libnfnetlink (versioned as 1.0.0-1.1) and uploaded it. Thanks to David Prevot for doing most of the work! Regards.
diff -u libnfnetlink-1.0.0/debian/changelog libnfnetlink-1.0.0/debian/changelog --- libnfnetlink-1.0.0/debian/changelog +++ libnfnetlink-1.0.0/debian/changelog @@ -1,3 +1,15 @@ +libnfnetlink (1.0.0-1.1) unstable; urgency=low + + [ David Prevot ] + * Non-maintainer upload. + * iftable: fix incomplete list of interfaces via nlif_query. RTM_GETLINK + with NLM_F_DUMP returns a multi-part netlink message. The existing code + only handled the first message of it, thus, ignoring the remaining + interfaces. This causes a bug in conntrackd. Report 8b15e48 from upstream. + (Closes: #684863). + + -- Christian Perrier <bubu...@debian.org> Tue, 01 Jan 2013 19:19:15 +0100 + libnfnetlink (1.0.0-1) unstable; urgency=low [ Max Kellermann ] only in patch2: unchanged: --- libnfnetlink-1.0.0.orig/src/rtnl.h +++ libnfnetlink-1.0.0/src/rtnl.h @@ -32,5 +32,6 @@ struct rtnl_handle *rtnl_open(void); void rtnl_close(struct rtnl_handle *rtnl_handle); int rtnl_receive(struct rtnl_handle *rtnl_handle); +int rtnl_receive_multi(struct rtnl_handle *rtnl_handle); #endif only in patch2: unchanged: --- libnfnetlink-1.0.0.orig/src/iftable.c +++ libnfnetlink-1.0.0/src/iftable.c @@ -295,6 +295,16 @@ return -1; } +static int nlif_catch_multi(struct nlif_handle *h) +{ + assert(h != NULL); + + if (h->rtnl_handle) + return rtnl_receive_multi(h->rtnl_handle); + + return -1; +} + /** * nlif_query - request a dump of interfaces available in the system * @h: pointer to a valid nlif_handler @@ -306,7 +316,7 @@ if (rtnl_dump_type(h->rtnl_handle, RTM_GETLINK) < 0) return -1; - return nlif_catch(h); + return nlif_catch_multi(h); } /** Returns socket descriptor for the netlink socket only in patch2: unchanged: --- libnfnetlink-1.0.0.orig/src/rtnl.c +++ libnfnetlink-1.0.0/src/rtnl.c @@ -193,6 +193,15 @@ return 1; } +int rtnl_receive_multi(struct rtnl_handle *rtnl_handle) +{ + while (1) { + if (rtnl_receive(rtnl_handle) <= 0) + break; + } + return 1; +} + /* rtnl_open - constructor of rtnetlink module */ struct rtnl_handle *rtnl_open(void) {