All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Minor bugfix
@ 2008-07-02 19:55 Jesper Dangaard Brouer
  2008-07-03 18:30 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Jesper Dangaard Brouer @ 2008-07-02 19:55 UTC (permalink / raw)
  To: Netfilter Developers; +Cc: Patrick McHardy

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

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
---
 libiptc/libiptc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c
index d0f51b4..ec5317b 100644
--- a/libiptc/libiptc.c
+++ b/libiptc/libiptc.c
@@ -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 */
-- 
1.5.3



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

end of thread, other threads:[~2008-07-03 18:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-02 19:55 [PATCH 1/2] Minor bugfix Jesper Dangaard Brouer
2008-07-03 18:30 ` Patrick McHardy

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.