summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-09-28 18:28:39 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2008-09-28 18:28:39 +0200
commit7a399ccded7086436dff2b55e6461b520cc952f6 (patch)
tree10f114797dfa877343c25eab56d26f81dc0c1ae1
parent99a80b3fe6af95ca711c2d37737408c3703a6184 (diff)
downloadconntrack-tools-7a399ccded7086436dff2b55e6461b520cc952f6.tar.gz
conntrack-tools-7a399ccded7086436dff2b55e6461b520cc952f6.zip
conntrack: cleanup for the update path
This patch cleans up the update path for the conntrack utility. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/conntrack.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/conntrack.c b/src/conntrack.c
index 7c12b39..568307a 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -787,21 +787,22 @@ static int update_cb(enum nf_conntrack_msg_type type,
char __tmp[nfct_maxsize()];
struct nf_conntrack *tmp = (struct nf_conntrack *) (void *)__tmp;
- memcpy(tmp, obj, sizeof(__tmp));
+ memset(tmp, 0, sizeof(__tmp));
- if (ignore_nat(tmp, ct))
+ if (ignore_nat(obj, ct))
return NFCT_CB_CONTINUE;
if (nfct_attr_is_set(obj, ATTR_ID) && nfct_attr_is_set(ct, ATTR_ID) &&
nfct_get_attr_u32(obj, ATTR_ID) != nfct_get_attr_u32(ct, ATTR_ID))
return NFCT_CB_CONTINUE;
- if (options & CT_OPT_TUPLE_ORIG && !nfct_cmp(tmp, ct, NFCT_CMP_ORIG))
+ if (options & CT_OPT_TUPLE_ORIG && !nfct_cmp(obj, ct, NFCT_CMP_ORIG))
return NFCT_CB_CONTINUE;
- if (options & CT_OPT_TUPLE_REPL && !nfct_cmp(tmp, ct, NFCT_CMP_REPL))
+ if (options & CT_OPT_TUPLE_REPL && !nfct_cmp(obj, ct, NFCT_CMP_REPL))
return NFCT_CB_CONTINUE;
nfct_copy(tmp, ct, NFCT_CP_ORIG);
+ nfct_copy(tmp, obj, NFCT_CP_META);
res = nfct_query(ith, NFCT_Q_UPDATE, tmp);
if (res < 0)