summaryrefslogtreecommitdiffstats
path: root/src/netlink.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-08-07 14:53:29 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2008-08-07 14:53:29 +0200
commit8a78dda3e6676286f09f5c78cca60a8178186930 (patch)
tree8b00a9b242e137c1233579bbe500ae123fd65191 /src/netlink.c
parent6cb33c62c8007593d8a85aa202fa173043877135 (diff)
cache iterators: commit master entries before related ones
Commit master entries before related ones to avoid ENOENT errors. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/netlink.c')
-rw-r--r--src/netlink.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/netlink.c b/src/netlink.c
index 0d9b7db..e9b1cfd 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -337,6 +337,18 @@ int nl_update_conntrack(struct nf_conntrack *ct)
nfct_set_attr_u32(ct, ATTR_STATUS, status);
}
+ /* we hit error if we try to update the master conntrack */
+ if (ct_is_related(ct)) {
+ nfct_attr_unset(ct, ATTR_MASTER_L3PROTO);
+ nfct_attr_unset(ct, ATTR_MASTER_L4PROTO);
+ nfct_attr_unset(ct, ATTR_MASTER_IPV4_SRC);
+ nfct_attr_unset(ct, ATTR_MASTER_IPV4_DST);
+ nfct_attr_unset(ct, ATTR_MASTER_IPV6_SRC);
+ nfct_attr_unset(ct, ATTR_MASTER_IPV6_DST);
+ nfct_attr_unset(ct, ATTR_MASTER_PORT_SRC);
+ nfct_attr_unset(ct, ATTR_MASTER_PORT_DST);
+ }
+
return nl_create_conntrack(ct);
}