summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-12-06 21:54:43 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2008-12-06 21:54:43 +0100
commit65ad316d921930c9d5c1c8640fbf2f05ecd0ca49 (patch)
tree9fc0427a023eaaba9a4619576dc979e2dae51ded /include
parent567222194512c6d42c7e253fc69c3837fe7b078c (diff)
downloadconntrack-tools-65ad316d921930c9d5c1c8640fbf2f05ecd0ca49.tar.gz
conntrack-tools-65ad316d921930c9d5c1c8640fbf2f05ecd0ca49.zip
netlink: clone conntrack object while creation/update
This patch changes the behaviour of nl_create_conntrack() and nl_update_conntrack() which now clone the conntrack object received as parameter. This was not required as these functions were called inside fork(), thus, they modified a copy of the real conntrack objects in the child process. However, this behaviour is broken following the try-again logic in __do_commit_step. For example, if we try to update an expected conntrack object that has vanished for whatever reason, since nl_update_conntrack() modifies the object (unset the master conntrack information), nl_create_conntrak() will create an entry without the master conntrack information. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r--include/netlink.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/netlink.h b/include/netlink.h
index 52482c1..7e2b94c 100644
--- a/include/netlink.h
+++ b/include/netlink.h
@@ -24,9 +24,9 @@ int nl_exist_conntrack(struct nf_conntrack *ct);
int nl_get_conntrack(struct nf_conntrack *ct);
-int nl_create_conntrack(struct nf_conntrack *ct);
+int nl_create_conntrack(const struct nf_conntrack *ct);
-int nl_update_conntrack(struct nf_conntrack *ct);
+int nl_update_conntrack(const struct nf_conntrack *ct);
int nl_destroy_conntrack(struct nf_conntrack *ct);