diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-05-27 11:50:35 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2009-05-27 11:50:35 -0400 |
commit | a17c859849402315613a0015ac8fbf101acf0cc1 (patch) | |
tree | b852a3ebd3bad0d531f1e09cf97c18b29ac96115 /net | |
parent | a2a804cddfe65f18f903985e8a8d04c7c9eec354 (diff) |
netfilter: conntrack: add support for DCCP handshake sequence to ctnetlink
This patch adds CTA_PROTOINFO_DCCP_HANDSHAKE_SEQ that exposes
the u64 handshake sequence number to user-space.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nf_conntrack_proto_dccp.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/netfilter/nf_conntrack_proto_dccp.c b/net/netfilter/nf_conntrack_proto_dccp.c index 8e757dd53396..11801c43c8cf 100644 --- a/net/netfilter/nf_conntrack_proto_dccp.c +++ b/net/netfilter/nf_conntrack_proto_dccp.c | |||
@@ -635,6 +635,8 @@ static int dccp_to_nlattr(struct sk_buff *skb, struct nlattr *nla, | |||
635 | NLA_PUT_U8(skb, CTA_PROTOINFO_DCCP_STATE, ct->proto.dccp.state); | 635 | NLA_PUT_U8(skb, CTA_PROTOINFO_DCCP_STATE, ct->proto.dccp.state); |
636 | NLA_PUT_U8(skb, CTA_PROTOINFO_DCCP_ROLE, | 636 | NLA_PUT_U8(skb, CTA_PROTOINFO_DCCP_ROLE, |
637 | ct->proto.dccp.role[IP_CT_DIR_ORIGINAL]); | 637 | ct->proto.dccp.role[IP_CT_DIR_ORIGINAL]); |
638 | NLA_PUT_BE64(skb, CTA_PROTOINFO_DCCP_HANDSHAKE_SEQ, | ||
639 | cpu_to_be64(ct->proto.dccp.handshake_seq)); | ||
638 | nla_nest_end(skb, nest_parms); | 640 | nla_nest_end(skb, nest_parms); |
639 | read_unlock_bh(&dccp_lock); | 641 | read_unlock_bh(&dccp_lock); |
640 | return 0; | 642 | return 0; |
@@ -647,6 +649,7 @@ nla_put_failure: | |||
647 | static const struct nla_policy dccp_nla_policy[CTA_PROTOINFO_DCCP_MAX + 1] = { | 649 | static const struct nla_policy dccp_nla_policy[CTA_PROTOINFO_DCCP_MAX + 1] = { |
648 | [CTA_PROTOINFO_DCCP_STATE] = { .type = NLA_U8 }, | 650 | [CTA_PROTOINFO_DCCP_STATE] = { .type = NLA_U8 }, |
649 | [CTA_PROTOINFO_DCCP_ROLE] = { .type = NLA_U8 }, | 651 | [CTA_PROTOINFO_DCCP_ROLE] = { .type = NLA_U8 }, |
652 | [CTA_PROTOINFO_DCCP_HANDSHAKE_SEQ] = { .type = NLA_U64 }, | ||
650 | }; | 653 | }; |
651 | 654 | ||
652 | static int nlattr_to_dccp(struct nlattr *cda[], struct nf_conn *ct) | 655 | static int nlattr_to_dccp(struct nlattr *cda[], struct nf_conn *ct) |
@@ -679,6 +682,10 @@ static int nlattr_to_dccp(struct nlattr *cda[], struct nf_conn *ct) | |||
679 | ct->proto.dccp.role[IP_CT_DIR_ORIGINAL] = CT_DCCP_ROLE_SERVER; | 682 | ct->proto.dccp.role[IP_CT_DIR_ORIGINAL] = CT_DCCP_ROLE_SERVER; |
680 | ct->proto.dccp.role[IP_CT_DIR_REPLY] = CT_DCCP_ROLE_CLIENT; | 683 | ct->proto.dccp.role[IP_CT_DIR_REPLY] = CT_DCCP_ROLE_CLIENT; |
681 | } | 684 | } |
685 | if (tb[CTA_PROTOINFO_DCCP_HANDSHAKE_SEQ]) { | ||
686 | ct->proto.dccp.handshake_seq = | ||
687 | be64_to_cpu(nla_get_be64(tb[CTA_PROTOINFO_DCCP_HANDSHAKE_SEQ])); | ||
688 | } | ||
682 | write_unlock_bh(&dccp_lock); | 689 | write_unlock_bh(&dccp_lock); |
683 | return 0; | 690 | return 0; |
684 | } | 691 | } |