Skip to contentSkip to conversation

Minor bugfix

PATCH Applied Jesper Dangaard Brouer 2 participants 2 messages Jul 2, 2008 – Jul 3, 2008 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Minor bugfix

Minor bugfix, an extra check is needed if the tail element is a builtin chain, as builtin chains are not sorted.

---
 libiptc/libiptc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
libiptc/libiptc.c +2 -1
index d0f51b4..ec5317b 100644
@@ -819,7 +819,8 @@ static void __iptcc_p_add_chain(TC_HANDLE_T h, struct chain_head *c,
 		list_add_tail(&c->list, &h->chains);
 	else {
 		ctail = list_entry(tail, struct chain_head, list);
-		if (strcmp(c->name, ctail->name) > 0)
+		if (strcmp(c->name, ctail->name) > 0 ||
+		    iptcc_is_builtin(ctail))
 			list_add_tail(&c->list, &h->chains);/* Already sorted*/
 		else
 			iptc_insert_chain(h, c);/* Was not sorted */
Signature · 1 line
1.5.3
#1 lore raw
Quoted 2 lines · Jesper Dangaard Brouer

Minor bugfix, an extra check is needed if the tail element is a builtin chain, as builtin chains are not sorted.

Applied, thanks.