]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Restore chain order (Olaf Rempel <razzor@kopf-tisch.de>)
authorOlaf Rempel <razzor@kopf-tisch.de>
Fri, 4 Mar 2005 23:08:30 +0000 (23:08 +0000)
committerPatrick McHardy <kaber@trash.net>
Fri, 4 Mar 2005 23:08:30 +0000 (23:08 +0000)
libiptc/libiptc.c

index d3d0fa7e8fd985d7e395b64670ba601c992f0b01..9f7d2ceeb3e6340d4638b2ef302550afdebc77e4 100644 (file)
@@ -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;
+                       }
                }
        }