From 6b08b0d31723e80a749aa26e5f2ae1374e45febe Mon Sep 17 00:00:00 2001 From: "/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=kaber/emailAddress=kaber@netfilter.org" Date: Fri, 4 Mar 2005 23:08:30 +0000 Subject: Restore chain order (Olaf Rempel ) --- libiptc/libiptc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c index d3d0fa7..9f7d2ce 100644 --- a/libiptc/libiptc.c +++ b/libiptc/libiptc.c @@ -396,10 +396,13 @@ static inline void iptc_insert_chain(TC_HANDLE_T h, struct chain_head *c) { struct chain_head *tmp; - list_for_each_entry(tmp, &h->chains, list) { - if (strcmp(c->name, tmp->name) <= 0) { - list_add(&c->list, tmp->list.prev); - return; + /* sort only user defined chains */ + if (!c->hooknum) { + list_for_each_entry(tmp, &h->chains, list) { + if (strcmp(c->name, tmp->name) <= 0) { + list_add(&c->list, tmp->list.prev); + return; + } } } -- cgit v1.2.3