summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-12-11 19:05:58 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2008-12-11 19:05:58 +0100
commit2473a408abdd79fb4b24c5c56f769791203c0cd8 (patch)
tree3d18b241c73f0380fefcbfa374a3e37ea71cb90d
parent99954a6233edd6a4e751bdd42dee515d3d00d372 (diff)
build: do not inconditionally include TCP state into netlink messagelibnetfilter_conntrack-0.0.99
This patch remove the inconditional inclusion of the TCP state attribute in netlink messages. We cannot assume this for update messages. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/conntrack/build.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/conntrack/build.c b/src/conntrack/build.c
index f9d6f8e..35abe05 100644
--- a/src/conntrack/build.c
+++ b/src/conntrack/build.c
@@ -106,8 +106,11 @@ void __build_protoinfo(struct nfnlhdr *req,
case IPPROTO_TCP:
nest = nfnl_nest(&req->nlh, size, CTA_PROTOINFO);
nest_proto = nfnl_nest(&req->nlh, size, CTA_PROTOINFO_TCP);
- nfnl_addattr_l(&req->nlh, size, CTA_PROTOINFO_TCP_STATE,
- &ct->protoinfo.tcp.state, sizeof(u_int8_t));
+ if (test_bit(ATTR_TCP_STATE, ct->set))
+ nfnl_addattr_l(&req->nlh, size,
+ CTA_PROTOINFO_TCP_STATE,
+ &ct->protoinfo.tcp.state,
+ sizeof(u_int8_t));
if (test_bit(ATTR_TCP_FLAGS_ORIG, ct->set) &&
test_bit(ATTR_TCP_MASK_ORIG, ct->set))
nfnl_addattr_l(&req->nlh, size,