summaryrefslogtreecommitdiffstats
path: root/src/conntrack/build.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/conntrack/build.c')
-rw-r--r--src/conntrack/build.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/conntrack/build.c b/src/conntrack/build.c
index dea0c75..623774f 100644
--- a/src/conntrack/build.c
+++ b/src/conntrack/build.c
@@ -160,11 +160,18 @@ static void __build_protoinfo(struct nfnlhdr *req, size_t size,
CTA_PROTOINFO_DCCP_ROLE,
&ct->protoinfo.dccp.role,
sizeof(u_int8_t));
- if (test_bit(ATTR_DCCP_HANDSHAKE_SEQ, ct->set))
+ if (test_bit(ATTR_DCCP_HANDSHAKE_SEQ, ct->set)) {
+ /* FIXME: use __cpu_to_be64() instead which is the
+ * correct operation. This is a semantic abuse but
+ * we have no function to do it in libnfnetlink. */
+ u_int64_t handshake_seq =
+ __be64_to_cpu(ct->protoinfo.dccp.handshake_seq);
+
nfnl_addattr_l(&req->nlh, size,
CTA_PROTOINFO_DCCP_SEQ,
- &ct->protoinfo.dccp.handshake_seq,
+ &handshake_seq,
sizeof(u_int64_t));
+ }
nfnl_nest_end(&req->nlh, nest_proto);
nfnl_nest_end(&req->nlh, nest);
default: