diff options
author | Holger Eitzenberger <holger@eitzenberger.org> | 2009-03-25 16:53:39 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2009-03-25 16:53:39 -0400 |
commit | a400c30edb1958ceb53c4b8ce78989189b36df47 (patch) | |
tree | 827ee7b83e64597101a4bdbd6e1d0cd503fe8f87 /net/ipv6 | |
parent | 5c0de29d06318ec8f6e3ba0d17d62529dbbdc1e8 (diff) |
netfilter: nf_conntrack: calculate per-protocol nlattr size
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c | 6 | ||||
-rw-r--r-- | net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c index e6852f617217..2a15c2d66c69 100644 --- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c | |||
@@ -342,6 +342,11 @@ static int ipv6_nlattr_to_tuple(struct nlattr *tb[], | |||
342 | 342 | ||
343 | return 0; | 343 | return 0; |
344 | } | 344 | } |
345 | |||
346 | static int ipv6_nlattr_tuple_size(void) | ||
347 | { | ||
348 | return nla_policy_len(ipv6_nla_policy, CTA_IP_MAX + 1); | ||
349 | } | ||
345 | #endif | 350 | #endif |
346 | 351 | ||
347 | struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6 __read_mostly = { | 352 | struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6 __read_mostly = { |
@@ -353,6 +358,7 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6 __read_mostly = { | |||
353 | .get_l4proto = ipv6_get_l4proto, | 358 | .get_l4proto = ipv6_get_l4proto, |
354 | #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) | 359 | #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) |
355 | .tuple_to_nlattr = ipv6_tuple_to_nlattr, | 360 | .tuple_to_nlattr = ipv6_tuple_to_nlattr, |
361 | .nlattr_tuple_size = ipv6_nlattr_tuple_size, | ||
356 | .nlattr_to_tuple = ipv6_nlattr_to_tuple, | 362 | .nlattr_to_tuple = ipv6_nlattr_to_tuple, |
357 | .nla_policy = ipv6_nla_policy, | 363 | .nla_policy = ipv6_nla_policy, |
358 | #endif | 364 | #endif |
diff --git a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c index 165b256a6fa0..032fdf415000 100644 --- a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +++ b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | |||
@@ -268,6 +268,11 @@ static int icmpv6_nlattr_to_tuple(struct nlattr *tb[], | |||
268 | 268 | ||
269 | return 0; | 269 | return 0; |
270 | } | 270 | } |
271 | |||
272 | static int icmpv6_nlattr_tuple_size(void) | ||
273 | { | ||
274 | return nla_policy_len(icmpv6_nla_policy, CTA_PROTO_MAX + 1); | ||
275 | } | ||
271 | #endif | 276 | #endif |
272 | 277 | ||
273 | #ifdef CONFIG_SYSCTL | 278 | #ifdef CONFIG_SYSCTL |
@@ -299,6 +304,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6 __read_mostly = | |||
299 | .error = icmpv6_error, | 304 | .error = icmpv6_error, |
300 | #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) | 305 | #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) |
301 | .tuple_to_nlattr = icmpv6_tuple_to_nlattr, | 306 | .tuple_to_nlattr = icmpv6_tuple_to_nlattr, |
307 | .nlattr_tuple_size = icmpv6_nlattr_tuple_size, | ||
302 | .nlattr_to_tuple = icmpv6_nlattr_to_tuple, | 308 | .nlattr_to_tuple = icmpv6_nlattr_to_tuple, |
303 | .nla_policy = icmpv6_nla_policy, | 309 | .nla_policy = icmpv6_nla_policy, |
304 | #endif | 310 | #endif |