diff options
-rw-r--r-- | include/linux/netfilter/nfnetlink_conntrack.h | 9 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_conntrack_proto_tcp.c | 4 |
2 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index 5c55751c78e4..fb5511030185 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -70,11 +70,18 @@ enum ctattr_l4proto { | |||
70 | 70 | ||
71 | enum ctattr_protoinfo { | 71 | enum ctattr_protoinfo { |
72 | CTA_PROTOINFO_UNSPEC, | 72 | CTA_PROTOINFO_UNSPEC, |
73 | CTA_PROTOINFO_TCP_STATE, | 73 | CTA_PROTOINFO_TCP, |
74 | __CTA_PROTOINFO_MAX | 74 | __CTA_PROTOINFO_MAX |
75 | }; | 75 | }; |
76 | #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) | 76 | #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) |
77 | 77 | ||
78 | enum ctattr_protoinfo_tcp { | ||
79 | CTA_PROTOINFO_TCP_UNSPEC, | ||
80 | CTA_PROTOINFO_TCP_STATE, | ||
81 | __CTA_PROTOINFO_TCP_MAX | ||
82 | }; | ||
83 | #define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1) | ||
84 | |||
78 | enum ctattr_counters { | 85 | enum ctattr_counters { |
79 | CTA_COUNTERS_UNSPEC, | 86 | CTA_COUNTERS_UNSPEC, |
80 | CTA_COUNTERS_PACKETS, | 87 | CTA_COUNTERS_PACKETS, |
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c index 121760d6cc50..75e27e65c28f 100644 --- a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c +++ b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c | |||
@@ -341,11 +341,15 @@ static int tcp_print_conntrack(struct seq_file *s, | |||
341 | static int tcp_to_nfattr(struct sk_buff *skb, struct nfattr *nfa, | 341 | static int tcp_to_nfattr(struct sk_buff *skb, struct nfattr *nfa, |
342 | const struct ip_conntrack *ct) | 342 | const struct ip_conntrack *ct) |
343 | { | 343 | { |
344 | struct nfattr *nest_parms = NFA_NEST(skb, CTA_PROTOINFO_TCP); | ||
345 | |||
344 | read_lock_bh(&tcp_lock); | 346 | read_lock_bh(&tcp_lock); |
345 | NFA_PUT(skb, CTA_PROTOINFO_TCP_STATE, sizeof(u_int8_t), | 347 | NFA_PUT(skb, CTA_PROTOINFO_TCP_STATE, sizeof(u_int8_t), |
346 | &ct->proto.tcp.state); | 348 | &ct->proto.tcp.state); |
347 | read_unlock_bh(&tcp_lock); | 349 | read_unlock_bh(&tcp_lock); |
348 | 350 | ||
351 | NFA_NEST_END(skb, nest_parms); | ||
352 | |||
349 | return 0; | 353 | return 0; |
350 | 354 | ||
351 | nfattr_failure: | 355 | nfattr_failure: |