diff options
author | Olaf Rempel <razzor@kopf-tisch.de> | 2005-03-04 23:08:30 +0000 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2005-03-04 23:08:30 +0000 |
commit | 9d3ed77341361674994f584ff69a61f31a342739 (patch) | |
tree | 54f67a75c729437617259cc2d3301980d0f34beb /libiptc | |
parent | 8115e5425721cd610b6390c3d4c24540773b0520 (diff) |
Restore chain order (Olaf Rempel <razzor@kopf-tisch.de>)
Diffstat (limited to 'libiptc')
-rw-r--r-- | libiptc/libiptc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c index d3d0fa7e..9f7d2cee 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; + } } } |