diff options
author | Jesper Dangaard Brouer <hawk@comx.dk> | 2008-07-03 20:29:34 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2008-07-03 20:29:34 +0200 |
commit | 526d3e138635e33773d1ca16477052a04f53f5bd (patch) | |
tree | cb9603ef9ceedee9f421cbaad1cb84e69b22033f /libiptc | |
parent | 55dffefc95151b5746a853c8ed71097d7b5a8575 (diff) |
libiptc: minor bugfix
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>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'libiptc')
-rw-r--r-- | libiptc/libiptc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c index d0f51b4a..ec5317bc 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 */ |