diff options
author | Mohit Mehta <mohit.mehta@vyatta.com> | 2010-06-17 10:34:10 -0700 |
---|---|---|
committer | Mohit Mehta <mohit.mehta@vyatta.com> | 2010-06-17 10:34:10 -0700 |
commit | fd9fddfe8d1835b42880d860a725b5394401b445 (patch) | |
tree | 5347023408a75a0b7d33db211244a545744ca555 /src | |
parent | 9d4ef82971020801af5b46ff26aee4d0ae7ea594 (diff) | |
download | conntrack-tools-fd9fddfe8d1835b42880d860a725b5394401b445.tar.gz conntrack-tools-fd9fddfe8d1835b42880d860a725b5394401b445.zip |
Revert "fix `conntrack -L --src-nat --dst-nat`"
This reverts commit b4d4591734726a7b38a579acf272022caf5a0534.
Diffstat (limited to 'src')
-rw-r--r-- | src/conntrack.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/conntrack.c b/src/conntrack.c index 7d413c7..eec3868 100644 --- a/src/conntrack.c +++ b/src/conntrack.c @@ -635,23 +635,27 @@ filter_nat(const struct nf_conntrack *obj, const struct nf_conntrack *ct) uint32_t ip; if (options & CT_OPT_SRC_NAT) { + if (!nfct_getobjopt(ct, NFCT_GOPT_IS_SNAT)) + return 1; + if (nfct_attr_is_set(obj, ATTR_SNAT_IPV4)) { ip = nfct_get_attr_u32(obj, ATTR_SNAT_IPV4); - if (ip == nfct_get_attr_u32(ct, ATTR_REPL_IPV4_DST)) - return 0; - } else if (nfct_getobjopt(ct, NFCT_GOPT_IS_SNAT)) - return 0; + if (ip != nfct_get_attr_u32(ct, ATTR_REPL_IPV4_DST)) + return 1; + } } if (options & CT_OPT_DST_NAT) { + if (!nfct_getobjopt(ct, NFCT_GOPT_IS_DNAT)) + return 1; + if (nfct_attr_is_set(obj, ATTR_DNAT_IPV4)) { ip = nfct_get_attr_u32(obj, ATTR_DNAT_IPV4); - if (ip == nfct_get_attr_u32(ct, ATTR_REPL_IPV4_SRC)) - return 0; - } else if (nfct_getobjopt(ct, NFCT_GOPT_IS_DNAT)) - return 0; + if (ip != nfct_get_attr_u32(ct, ATTR_REPL_IPV4_SRC)) + return 1; + } } - return 1; + return 0; } static int counter; |