From: Jesper Dangaard Brouer <jdb@comx.dk>
To: Netfilter Developers <netfilter-devel@vger.kernel.org>
Cc: Patrick McHardy <kaber@trash.net>
Subject: [PATCH 1/2] Minor bugfix
Date: Wed, 02 Jul 2008 21:55:16 +0200 [thread overview]
Message-ID: <1215028516.9467.2.camel@localhost.localdomain> (raw)
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
next reply other threads:[~2008-07-02 19:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-02 19:55 Jesper Dangaard Brouer [this message]
2008-07-03 18:30 ` [PATCH 1/2] Minor bugfix Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1215028516.9467.2.camel@localhost.localdomain \
--to=jdb@comx.dk \
--cc=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox