All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 1/1 libnetfilter_conntrack] zero value handling of mark and zone
@ 2014-06-11 23:42 Ken-ichirou MATSUZAWA
  2014-06-12  0:18 ` Florian Westphal
  0 siblings, 1 reply; 13+ messages in thread
From: Ken-ichirou MATSUZAWA @ 2014-06-11 23:42 UTC (permalink / raw)
  To: The netfilter developer mailinglist; +Cc: Pablo Neira Ayuso

This patch enables comparison of 0 value with mark and zone since
both CTA_MARK and CTA_ZONE are not set in case of its value is 0.

Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
---
 src/conntrack/compare.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/conntrack/compare.c b/src/conntrack/compare.c
index f4a194a..06edd0d 100644
--- a/src/conntrack/compare.c
+++ b/src/conntrack/compare.c
@@ -24,8 +24,12 @@ static int __cmp(int attr,
        } else if (!a && !b) {
                return 1;
        } else if (flags & NFCT_CMP_MASK &&
-                  test_bit(attr, ct1->head.set)) {
-               return 0;
+                  !test_bit(attr, ct1->head.set)) {
+               return 1;
+       } else if (attr == ATTR_MARK) {
+               return ct1->mark == 0 && ct2->mark == 0;
+       } else if (attr == ATTR_ZONE) {
+               return ct1->zone == 0 && ct2->zone == 0;
        } else if (flags & NFCT_CMP_STRICT) {
                return 0;
        }
--
1.9.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-06-16 13:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-11 23:42 [RFC PATCH 1/1 libnetfilter_conntrack] zero value handling of mark and zone Ken-ichirou MATSUZAWA
2014-06-12  0:18 ` Florian Westphal
2014-06-12  5:19   ` Ken-ichirou MATSUZAWA
2014-06-12  9:48     ` Florian Westphal
2014-06-12 11:33       ` Ken-ichirou MATSUZAWA
2014-06-12 11:59         ` Florian Westphal
2014-06-12 13:43           ` Ken-ichirou MATSUZAWA
2014-06-12 14:05             ` Florian Westphal
2014-06-12 23:12               ` Ken-ichirou MATSUZAWA
2014-06-16  0:04       ` Ken-ichirou MATSUZAWA
2014-06-16 11:41         ` Florian Westphal
2014-06-16 13:20           ` Ken-ichirou MATSUZAWA
2014-06-16 13:24             ` Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.