diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-07 19:18:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-07 19:18:50 -0400 |
commit | d3a5ea6e2188adeea028c410c83c90e6b6d9347c (patch) | |
tree | 7035d790158da6fad3c482afa545b3dba2e6b037 /net/ipv6 | |
parent | 8ce5c9f27d2e2ce415d903d916e848a356d4c0c0 (diff) | |
parent | 46ba5a25f521e3c50d7bb81b1abb977769047456 (diff) |
Merge branch 'master' of git://1984.lsi.us.es/nf-next
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c index 63ed0121836c..2d54b2061d68 100644 --- a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +++ b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | |||
@@ -333,22 +333,36 @@ static struct ctl_table icmpv6_sysctl_table[] = { | |||
333 | }; | 333 | }; |
334 | #endif /* CONFIG_SYSCTL */ | 334 | #endif /* CONFIG_SYSCTL */ |
335 | 335 | ||
336 | static int icmpv6_init_net(struct net *net) | 336 | static int icmpv6_kmemdup_sysctl_table(struct nf_proto_net *pn, |
337 | struct nf_icmp_net *in) | ||
337 | { | 338 | { |
338 | struct nf_icmp_net *in = icmpv6_pernet(net); | ||
339 | struct nf_proto_net *pn = (struct nf_proto_net *)in; | ||
340 | in->timeout = nf_ct_icmpv6_timeout; | ||
341 | #ifdef CONFIG_SYSCTL | 339 | #ifdef CONFIG_SYSCTL |
342 | pn->ctl_table = kmemdup(icmpv6_sysctl_table, | 340 | pn->ctl_table = kmemdup(icmpv6_sysctl_table, |
343 | sizeof(icmpv6_sysctl_table), | 341 | sizeof(icmpv6_sysctl_table), |
344 | GFP_KERNEL); | 342 | GFP_KERNEL); |
345 | if (!pn->ctl_table) | 343 | if (!pn->ctl_table) |
346 | return -ENOMEM; | 344 | return -ENOMEM; |
345 | |||
347 | pn->ctl_table[0].data = &in->timeout; | 346 | pn->ctl_table[0].data = &in->timeout; |
348 | #endif | 347 | #endif |
349 | return 0; | 348 | return 0; |
350 | } | 349 | } |
351 | 350 | ||
351 | static int icmpv6_init_net(struct net *net, u_int16_t proto) | ||
352 | { | ||
353 | struct nf_icmp_net *in = icmpv6_pernet(net); | ||
354 | struct nf_proto_net *pn = &in->pn; | ||
355 | |||
356 | in->timeout = nf_ct_icmpv6_timeout; | ||
357 | |||
358 | return icmpv6_kmemdup_sysctl_table(pn, in); | ||
359 | } | ||
360 | |||
361 | static struct nf_proto_net *icmpv6_get_net_proto(struct net *net) | ||
362 | { | ||
363 | return &net->ct.nf_ct_proto.icmpv6.pn; | ||
364 | } | ||
365 | |||
352 | struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6 __read_mostly = | 366 | struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6 __read_mostly = |
353 | { | 367 | { |
354 | .l3proto = PF_INET6, | 368 | .l3proto = PF_INET6, |
@@ -377,4 +391,5 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6 __read_mostly = | |||
377 | }, | 391 | }, |
378 | #endif /* CONFIG_NF_CT_NETLINK_TIMEOUT */ | 392 | #endif /* CONFIG_NF_CT_NETLINK_TIMEOUT */ |
379 | .init_net = icmpv6_init_net, | 393 | .init_net = icmpv6_init_net, |
394 | .get_net_proto = icmpv6_get_net_proto, | ||
380 | }; | 395 | }; |