diff options
Diffstat (limited to 'net/ipv6/reassembly.c')
| -rw-r--r-- | net/ipv6/reassembly.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 2cddea3bd6be..a555156e9779 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
| @@ -228,7 +228,7 @@ static void ip6_frag_expire(unsigned long data) | |||
| 228 | pointer directly, device might already disappeared. | 228 | pointer directly, device might already disappeared. |
| 229 | */ | 229 | */ |
| 230 | fq->q.fragments->dev = dev; | 230 | fq->q.fragments->dev = dev; |
| 231 | icmpv6_send(fq->q.fragments, ICMPV6_TIME_EXCEED, ICMPV6_EXC_FRAGTIME, 0, dev); | 231 | icmpv6_send(fq->q.fragments, ICMPV6_TIME_EXCEED, ICMPV6_EXC_FRAGTIME, 0); |
| 232 | out_rcu_unlock: | 232 | out_rcu_unlock: |
| 233 | rcu_read_unlock(); | 233 | rcu_read_unlock(); |
| 234 | out: | 234 | out: |
| @@ -237,8 +237,7 @@ out: | |||
| 237 | } | 237 | } |
| 238 | 238 | ||
| 239 | static __inline__ struct frag_queue * | 239 | static __inline__ struct frag_queue * |
| 240 | fq_find(struct net *net, __be32 id, struct in6_addr *src, struct in6_addr *dst, | 240 | fq_find(struct net *net, __be32 id, struct in6_addr *src, struct in6_addr *dst) |
| 241 | struct inet6_dev *idev) | ||
| 242 | { | 241 | { |
| 243 | struct inet_frag_queue *q; | 242 | struct inet_frag_queue *q; |
| 244 | struct ip6_create_arg arg; | 243 | struct ip6_create_arg arg; |
| @@ -254,13 +253,9 @@ fq_find(struct net *net, __be32 id, struct in6_addr *src, struct in6_addr *dst, | |||
| 254 | 253 | ||
| 255 | q = inet_frag_find(&net->ipv6.frags, &ip6_frags, &arg, hash); | 254 | q = inet_frag_find(&net->ipv6.frags, &ip6_frags, &arg, hash); |
| 256 | if (q == NULL) | 255 | if (q == NULL) |
| 257 | goto oom; | 256 | return NULL; |
| 258 | 257 | ||
| 259 | return container_of(q, struct frag_queue, q); | 258 | return container_of(q, struct frag_queue, q); |
| 260 | |||
| 261 | oom: | ||
| 262 | IP6_INC_STATS_BH(net, idev, IPSTATS_MIB_REASMFAILS); | ||
| 263 | return NULL; | ||
| 264 | } | 259 | } |
| 265 | 260 | ||
| 266 | static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, | 261 | static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, |
| @@ -606,8 +601,8 @@ static int ipv6_frag_rcv(struct sk_buff *skb) | |||
| 606 | if (atomic_read(&net->ipv6.frags.mem) > net->ipv6.frags.high_thresh) | 601 | if (atomic_read(&net->ipv6.frags.mem) > net->ipv6.frags.high_thresh) |
| 607 | ip6_evictor(net, ip6_dst_idev(skb_dst(skb))); | 602 | ip6_evictor(net, ip6_dst_idev(skb_dst(skb))); |
| 608 | 603 | ||
| 609 | if ((fq = fq_find(net, fhdr->identification, &hdr->saddr, &hdr->daddr, | 604 | fq = fq_find(net, fhdr->identification, &hdr->saddr, &hdr->daddr); |
| 610 | ip6_dst_idev(skb_dst(skb)))) != NULL) { | 605 | if (fq != NULL) { |
| 611 | int ret; | 606 | int ret; |
| 612 | 607 | ||
| 613 | spin_lock(&fq->q.lock); | 608 | spin_lock(&fq->q.lock); |
| @@ -672,7 +667,7 @@ static struct ctl_table ip6_frags_ctl_table[] = { | |||
| 672 | { } | 667 | { } |
| 673 | }; | 668 | }; |
| 674 | 669 | ||
| 675 | static int ip6_frags_ns_sysctl_register(struct net *net) | 670 | static int __net_init ip6_frags_ns_sysctl_register(struct net *net) |
| 676 | { | 671 | { |
| 677 | struct ctl_table *table; | 672 | struct ctl_table *table; |
| 678 | struct ctl_table_header *hdr; | 673 | struct ctl_table_header *hdr; |
| @@ -702,7 +697,7 @@ err_alloc: | |||
| 702 | return -ENOMEM; | 697 | return -ENOMEM; |
| 703 | } | 698 | } |
| 704 | 699 | ||
| 705 | static void ip6_frags_ns_sysctl_unregister(struct net *net) | 700 | static void __net_exit ip6_frags_ns_sysctl_unregister(struct net *net) |
| 706 | { | 701 | { |
| 707 | struct ctl_table *table; | 702 | struct ctl_table *table; |
| 708 | 703 | ||
| @@ -745,10 +740,10 @@ static inline void ip6_frags_sysctl_unregister(void) | |||
| 745 | } | 740 | } |
| 746 | #endif | 741 | #endif |
| 747 | 742 | ||
| 748 | static int ipv6_frags_init_net(struct net *net) | 743 | static int __net_init ipv6_frags_init_net(struct net *net) |
| 749 | { | 744 | { |
| 750 | net->ipv6.frags.high_thresh = 256 * 1024; | 745 | net->ipv6.frags.high_thresh = IPV6_FRAG_HIGH_THRESH; |
| 751 | net->ipv6.frags.low_thresh = 192 * 1024; | 746 | net->ipv6.frags.low_thresh = IPV6_FRAG_LOW_THRESH; |
| 752 | net->ipv6.frags.timeout = IPV6_FRAG_TIMEOUT; | 747 | net->ipv6.frags.timeout = IPV6_FRAG_TIMEOUT; |
| 753 | 748 | ||
| 754 | inet_frags_init_net(&net->ipv6.frags); | 749 | inet_frags_init_net(&net->ipv6.frags); |
| @@ -756,7 +751,7 @@ static int ipv6_frags_init_net(struct net *net) | |||
| 756 | return ip6_frags_ns_sysctl_register(net); | 751 | return ip6_frags_ns_sysctl_register(net); |
| 757 | } | 752 | } |
| 758 | 753 | ||
| 759 | static void ipv6_frags_exit_net(struct net *net) | 754 | static void __net_exit ipv6_frags_exit_net(struct net *net) |
| 760 | { | 755 | { |
| 761 | ip6_frags_ns_sysctl_unregister(net); | 756 | ip6_frags_ns_sysctl_unregister(net); |
| 762 | inet_frags_exit_net(&net->ipv6.frags, &ip6_frags); | 757 | inet_frags_exit_net(&net->ipv6.frags, &ip6_frags); |
