diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-04-24 12:23:03 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-04-24 12:23:03 +0200 |
commit | b808645ec71b7cc22cf5106b3d79625d07e6077c (patch) | |
tree | 61c454be50eea566855ad40cbe641ba3c0b3e64b /src/build.c | |
parent | 7866b938a909439fa09ea7f16f8676cdac5ea532 (diff) | |
download | conntrack-tools-b808645ec71b7cc22cf5106b3d79625d07e6077c.tar.gz conntrack-tools-b808645ec71b7cc22cf5106b3d79625d07e6077c.zip |
sync: add support for DCCP state replication
This patch adds initial support for DCCP state replication.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/build.c')
-rw-r--r-- | src/build.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/build.c b/src/build.c index 6b0fad7..a02a912 100644 --- a/src/build.c +++ b/src/build.c @@ -103,6 +103,16 @@ __build_sctp(const struct nf_conntrack *ct, struct nethdr *n) addattr(n, NTA_STATE_SCTP, &data, sizeof(struct nta_attr_sctp)); } +static inline void +__build_dccp(const struct nf_conntrack *ct, struct nethdr *n) +{ + struct nta_attr_dccp data = { + .state = nfct_get_attr_u8(ct, ATTR_DCCP_STATE), + .role = nfct_get_attr_u8(ct, ATTR_DCCP_ROLE), + }; + addattr(n, NTA_STATE_DCCP, &data, sizeof(struct nta_attr_dccp)); +} + static enum nf_conntrack_attr nat_type[] = { ATTR_ORIG_NAT_SEQ_CORRECTION_POS, ATTR_ORIG_NAT_SEQ_OFFSET_BEFORE, ATTR_ORIG_NAT_SEQ_OFFSET_AFTER, ATTR_REPL_NAT_SEQ_CORRECTION_POS, @@ -131,6 +141,8 @@ void build_payload(const struct nf_conntrack *ct, struct nethdr *n) __build_u8(ct, ATTR_TCP_STATE, n, NTA_STATE_TCP); else if (nfct_attr_is_set(ct, ATTR_SCTP_STATE)) __build_sctp(ct, n); + else if (nfct_attr_is_set(ct, ATTR_DCCP_STATE)) + __build_dccp(ct, n); if (!CONFIG(commit_timeout) && nfct_attr_is_set(ct, ATTR_TIMEOUT)) __build_u32(ct, ATTR_TIMEOUT, n, NTA_TIMEOUT); |