[RFC PATCH 1/1 libnetfilter_conntrack] zero value handling of mark and zone

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 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
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux