simplify list handing in ifname2index infrastructure
Pablo Neira Ayuso
maintainerPATCH 1/1 simplify list handing in ifname2index infrastructure
Hi!
The patch attached simplifies the ifname2index list handling by using linux list and it introduces minor cleanups such as remove iftb_log() calls. This patch also fixes the leak in the nlif_close path (we forgot to release the ifindex nodes from the hashes) that Anton has reported.
Slightly tested here. If you are OK with it I'll apply it asap.
Signature · 1 line
"Los honestos son inadaptados sociales" -- Les Luthiers
configure.in +1 -1
@@ -1,6 +1,6 @@ dnl Process this file with autoconf to create configure. -AC_INIT(libnfnetlink, 0.0.35) +AC_INIT(libnfnetlink, 0.0.37) AC_CANONICAL_SYSTEM
include/Makefile.am +1 -2
@@ -1,3 +1,2 @@ - SUBDIRS = libnfnetlink - +noinst_HEADERS = linux_list.h
include/linux_list.h new file +727 -0
727 lines not on this page · raw message
src/iftable.c +85 -93
306 lines not on this page · raw message
src/rtnl.c +2 -1
@@ -91,9 +91,10 @@ int rtnl_handler_unregister(struct rtnl_handle *rtnl_handle,return 0 ; } -/* rtnl_arse_rtattr - parse rtattr */ int rtnl_parse_rtattr (struct rtattr *tb[],int max,struct rtattr *rta,int len) { +memset (tb,0 ,sizeof (struct rtattr *) * max); +while (RTA_OK (rta, len)) {if (rta->rta_type <= max) tb[rta->rta_type] = rta;
Hello,
Quoted 8 lines · Pablo Neira Ayuso
Hi!
The patch attached simplifies the ifname2index list handling by using linux list and it introduces minor cleanups such as remove
iftb_log()calls. This patch also fixes the leak in thenlif_closepath (we forgot to release the ifindex nodes from the hashes) that Anton has reported.Slightly tested here. If you are OK with it I'll apply it asap.
Maybe, this patch is a little too much for a code which should disappear for libnl ?
BR,
Signature · 3 lines
Eric Leblond INL: http://www.inl.fr/ NuFW: http://www.nufw.org/
Pablo Neira Ayuso
maintainerQuoted 10 lines · Eric Leblond
Hello,
Quoted 7 lines · Pablo Neira Ayuso
Hi!
The patch attached simplifies the ifname2index list handling by using linux list and it introduces minor cleanups such as remove
iftb_log()calls. This patch also fixes the leak in thenlif_closepath (we forgot to release the ifindex nodes from the hashes) that Anton has reported.
Quoted 4 lines
Quoted 1 line
Slightly tested here. If you are OK with it I'll apply it asap.
Maybe, this patch is a little too much for a code which should disappear for libnl ?
Well, the current code is broken and we have to fix it anyway. If you don't have any other objection I'll apply it asap.
Signature · 1 line
"Los honestos son inadaptados sociales" -- Les Luthiers
Hello,
Quoted 11 lines · Pablo Neira Ayuso
Quoted 10 lines · Eric Leblond
Hello,
Quoted 7 lines · Pablo Neira Ayuso
Hi!
The patch attached simplifies the ifname2index list handling by using linux list and it introduces minor cleanups such as remove
iftb_log()calls. This patch also fixes the leak in thenlif_closepath (we forgot to release the ifindex nodes from the hashes) that Anton has reported.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Slightly tested here. If you are OK with it I'll apply it asap.
Maybe, this patch is a little too much for a code which should disappear for libnl ?
Well, the current code is broken and we have to fix it anyway. If you don't have any other objection I'll apply it asap.
My patch fixes the issue without too much changes and we use current code in NuFW without trouble for years. As we have only one open, we don't suffer from the memory leak.
BR,
Signature · 3 lines
Eric Leblond INL: http://www.inl.fr/ NuFW: http://www.nufw.org/