diff options
-rw-r--r-- | include/linux/netfilter/nfnetlink_conntrack.h | 1 | ||||
-rw-r--r-- | include/net/netlink.h | 9 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_proto_dccp.c | 7 |
3 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index 1a865e48b8eb..ed4ef8d0b11b 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -101,6 +101,7 @@ enum ctattr_protoinfo_dccp { | |||
101 | CTA_PROTOINFO_DCCP_UNSPEC, | 101 | CTA_PROTOINFO_DCCP_UNSPEC, |
102 | CTA_PROTOINFO_DCCP_STATE, | 102 | CTA_PROTOINFO_DCCP_STATE, |
103 | CTA_PROTOINFO_DCCP_ROLE, | 103 | CTA_PROTOINFO_DCCP_ROLE, |
104 | CTA_PROTOINFO_DCCP_HANDSHAKE_SEQ, | ||
104 | __CTA_PROTOINFO_DCCP_MAX, | 105 | __CTA_PROTOINFO_DCCP_MAX, |
105 | }; | 106 | }; |
106 | #define CTA_PROTOINFO_DCCP_MAX (__CTA_PROTOINFO_DCCP_MAX - 1) | 107 | #define CTA_PROTOINFO_DCCP_MAX (__CTA_PROTOINFO_DCCP_MAX - 1) |
diff --git a/include/net/netlink.h b/include/net/netlink.h index eddb50289d6d..007bdb07dabb 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -940,6 +940,15 @@ static inline u64 nla_get_u64(const struct nlattr *nla) | |||
940 | } | 940 | } |
941 | 941 | ||
942 | /** | 942 | /** |
943 | * nla_get_be64 - return payload of __be64 attribute | ||
944 | * @nla: __be64 netlink attribute | ||
945 | */ | ||
946 | static inline __be64 nla_get_be64(const struct nlattr *nla) | ||
947 | { | ||
948 | return *(__be64 *) nla_data(nla); | ||
949 | } | ||
950 | |||
951 | /** | ||
943 | * nla_get_flag - return payload of flag attribute | 952 | * nla_get_flag - return payload of flag attribute |
944 | * @nla: flag netlink attribute | 953 | * @nla: flag netlink attribute |
945 | */ | 954 | */ |
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 | } |