diff options
author | Eric Dumazet <edumazet@google.com> | 2018-03-31 15:58:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-31 23:25:38 -0400 |
commit | 093ba72914b696521e4885756a68a3332782c8de (patch) | |
tree | b5a00fd3849991e7300e87d707630bf7fef54e67 | |
parent | 787bea7748a76130566f881c2342a0be4127d182 (diff) |
inet: frags: add a pointer to struct netns_frags
In order to simplify the API, add a pointer to struct inet_frags.
This will allow us to make things less complex.
These functions no longer have a struct inet_frags parameter :
inet_frag_destroy(struct inet_frag_queue *q /*, struct inet_frags *f */)
inet_frag_put(struct inet_frag_queue *q /*, struct inet_frags *f */)
inet_frag_kill(struct inet_frag_queue *q /*, struct inet_frags *f */)
inet_frags_exit_net(struct netns_frags *nf /*, struct inet_frags *f */)
ip6_expire_frag_queue(struct net *net, struct frag_queue *fq)
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/inet_frag.h | 11 | ||||
-rw-r--r-- | include/net/ipv6.h | 3 | ||||
-rw-r--r-- | net/ieee802154/6lowpan/reassembly.c | 13 | ||||
-rw-r--r-- | net/ipv4/inet_fragment.c | 17 | ||||
-rw-r--r-- | net/ipv4/ip_fragment.c | 9 | ||||
-rw-r--r-- | net/ipv6/netfilter/nf_conntrack_reasm.c | 16 | ||||
-rw-r--r-- | net/ipv6/reassembly.c | 20 |
7 files changed, 48 insertions, 41 deletions
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index b1d62176f3b4..69e531ed8189 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h | |||
@@ -10,6 +10,7 @@ struct netns_frags { | |||
10 | int high_thresh; | 10 | int high_thresh; |
11 | int low_thresh; | 11 | int low_thresh; |
12 | int max_dist; | 12 | int max_dist; |
13 | struct inet_frags *f; | ||
13 | }; | 14 | }; |
14 | 15 | ||
15 | /** | 16 | /** |
@@ -109,20 +110,20 @@ static inline int inet_frags_init_net(struct netns_frags *nf) | |||
109 | atomic_set(&nf->mem, 0); | 110 | atomic_set(&nf->mem, 0); |
110 | return 0; | 111 | return 0; |
111 | } | 112 | } |
112 | void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f); | 113 | void inet_frags_exit_net(struct netns_frags *nf); |
113 | 114 | ||
114 | void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f); | 115 | void inet_frag_kill(struct inet_frag_queue *q); |
115 | void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f); | 116 | void inet_frag_destroy(struct inet_frag_queue *q); |
116 | struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, | 117 | struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, |
117 | struct inet_frags *f, void *key, unsigned int hash); | 118 | struct inet_frags *f, void *key, unsigned int hash); |
118 | 119 | ||
119 | void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q, | 120 | void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q, |
120 | const char *prefix); | 121 | const char *prefix); |
121 | 122 | ||
122 | static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f) | 123 | static inline void inet_frag_put(struct inet_frag_queue *q) |
123 | { | 124 | { |
124 | if (refcount_dec_and_test(&q->refcnt)) | 125 | if (refcount_dec_and_test(&q->refcnt)) |
125 | inet_frag_destroy(q, f); | 126 | inet_frag_destroy(q); |
126 | } | 127 | } |
127 | 128 | ||
128 | static inline bool inet_frag_evicting(struct inet_frag_queue *q) | 129 | static inline bool inet_frag_evicting(struct inet_frag_queue *q) |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 5c18836672e9..57b7fe43d2ab 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -607,8 +607,7 @@ struct frag_queue { | |||
607 | u8 ecn; | 607 | u8 ecn; |
608 | }; | 608 | }; |
609 | 609 | ||
610 | void ip6_expire_frag_queue(struct net *net, struct frag_queue *fq, | 610 | void ip6_expire_frag_queue(struct net *net, struct frag_queue *fq); |
611 | struct inet_frags *frags); | ||
612 | 611 | ||
613 | static inline bool ipv6_addr_any(const struct in6_addr *a) | 612 | static inline bool ipv6_addr_any(const struct in6_addr *a) |
614 | { | 613 | { |
diff --git a/net/ieee802154/6lowpan/reassembly.c b/net/ieee802154/6lowpan/reassembly.c index 2aaab4bba429..6badc055555b 100644 --- a/net/ieee802154/6lowpan/reassembly.c +++ b/net/ieee802154/6lowpan/reassembly.c | |||
@@ -94,10 +94,10 @@ static void lowpan_frag_expire(struct timer_list *t) | |||
94 | if (fq->q.flags & INET_FRAG_COMPLETE) | 94 | if (fq->q.flags & INET_FRAG_COMPLETE) |
95 | goto out; | 95 | goto out; |
96 | 96 | ||
97 | inet_frag_kill(&fq->q, &lowpan_frags); | 97 | inet_frag_kill(&fq->q); |
98 | out: | 98 | out: |
99 | spin_unlock(&fq->q.lock); | 99 | spin_unlock(&fq->q.lock); |
100 | inet_frag_put(&fq->q, &lowpan_frags); | 100 | inet_frag_put(&fq->q); |
101 | } | 101 | } |
102 | 102 | ||
103 | static inline struct lowpan_frag_queue * | 103 | static inline struct lowpan_frag_queue * |
@@ -230,7 +230,7 @@ static int lowpan_frag_reasm(struct lowpan_frag_queue *fq, struct sk_buff *prev, | |||
230 | struct sk_buff *fp, *head = fq->q.fragments; | 230 | struct sk_buff *fp, *head = fq->q.fragments; |
231 | int sum_truesize; | 231 | int sum_truesize; |
232 | 232 | ||
233 | inet_frag_kill(&fq->q, &lowpan_frags); | 233 | inet_frag_kill(&fq->q); |
234 | 234 | ||
235 | /* Make the one we just received the head. */ | 235 | /* Make the one we just received the head. */ |
236 | if (prev) { | 236 | if (prev) { |
@@ -438,7 +438,7 @@ int lowpan_frag_rcv(struct sk_buff *skb, u8 frag_type) | |||
438 | ret = lowpan_frag_queue(fq, skb, frag_type); | 438 | ret = lowpan_frag_queue(fq, skb, frag_type); |
439 | spin_unlock(&fq->q.lock); | 439 | spin_unlock(&fq->q.lock); |
440 | 440 | ||
441 | inet_frag_put(&fq->q, &lowpan_frags); | 441 | inet_frag_put(&fq->q); |
442 | return ret; | 442 | return ret; |
443 | } | 443 | } |
444 | 444 | ||
@@ -586,13 +586,14 @@ static int __net_init lowpan_frags_init_net(struct net *net) | |||
586 | ieee802154_lowpan->frags.high_thresh = IPV6_FRAG_HIGH_THRESH; | 586 | ieee802154_lowpan->frags.high_thresh = IPV6_FRAG_HIGH_THRESH; |
587 | ieee802154_lowpan->frags.low_thresh = IPV6_FRAG_LOW_THRESH; | 587 | ieee802154_lowpan->frags.low_thresh = IPV6_FRAG_LOW_THRESH; |
588 | ieee802154_lowpan->frags.timeout = IPV6_FRAG_TIMEOUT; | 588 | ieee802154_lowpan->frags.timeout = IPV6_FRAG_TIMEOUT; |
589 | ieee802154_lowpan->frags.f = &lowpan_frags; | ||
589 | 590 | ||
590 | res = inet_frags_init_net(&ieee802154_lowpan->frags); | 591 | res = inet_frags_init_net(&ieee802154_lowpan->frags); |
591 | if (res < 0) | 592 | if (res < 0) |
592 | return res; | 593 | return res; |
593 | res = lowpan_frags_ns_sysctl_register(net); | 594 | res = lowpan_frags_ns_sysctl_register(net); |
594 | if (res < 0) | 595 | if (res < 0) |
595 | inet_frags_exit_net(&ieee802154_lowpan->frags, &lowpan_frags); | 596 | inet_frags_exit_net(&ieee802154_lowpan->frags); |
596 | return res; | 597 | return res; |
597 | } | 598 | } |
598 | 599 | ||
@@ -602,7 +603,7 @@ static void __net_exit lowpan_frags_exit_net(struct net *net) | |||
602 | net_ieee802154_lowpan(net); | 603 | net_ieee802154_lowpan(net); |
603 | 604 | ||
604 | lowpan_frags_ns_sysctl_unregister(net); | 605 | lowpan_frags_ns_sysctl_unregister(net); |
605 | inet_frags_exit_net(&ieee802154_lowpan->frags, &lowpan_frags); | 606 | inet_frags_exit_net(&ieee802154_lowpan->frags); |
606 | } | 607 | } |
607 | 608 | ||
608 | static struct pernet_operations lowpan_frags_ops = { | 609 | static struct pernet_operations lowpan_frags_ops = { |
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index e8ec28999f5c..1ac69f65d0de 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c | |||
@@ -219,8 +219,9 @@ void inet_frags_fini(struct inet_frags *f) | |||
219 | } | 219 | } |
220 | EXPORT_SYMBOL(inet_frags_fini); | 220 | EXPORT_SYMBOL(inet_frags_fini); |
221 | 221 | ||
222 | void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f) | 222 | void inet_frags_exit_net(struct netns_frags *nf) |
223 | { | 223 | { |
224 | struct inet_frags *f =nf->f; | ||
224 | unsigned int seq; | 225 | unsigned int seq; |
225 | int i; | 226 | int i; |
226 | 227 | ||
@@ -264,33 +265,34 @@ __acquires(hb->chain_lock) | |||
264 | return hb; | 265 | return hb; |
265 | } | 266 | } |
266 | 267 | ||
267 | static inline void fq_unlink(struct inet_frag_queue *fq, struct inet_frags *f) | 268 | static inline void fq_unlink(struct inet_frag_queue *fq) |
268 | { | 269 | { |
269 | struct inet_frag_bucket *hb; | 270 | struct inet_frag_bucket *hb; |
270 | 271 | ||
271 | hb = get_frag_bucket_locked(fq, f); | 272 | hb = get_frag_bucket_locked(fq, fq->net->f); |
272 | hlist_del(&fq->list); | 273 | hlist_del(&fq->list); |
273 | fq->flags |= INET_FRAG_COMPLETE; | 274 | fq->flags |= INET_FRAG_COMPLETE; |
274 | spin_unlock(&hb->chain_lock); | 275 | spin_unlock(&hb->chain_lock); |
275 | } | 276 | } |
276 | 277 | ||
277 | void inet_frag_kill(struct inet_frag_queue *fq, struct inet_frags *f) | 278 | void inet_frag_kill(struct inet_frag_queue *fq) |
278 | { | 279 | { |
279 | if (del_timer(&fq->timer)) | 280 | if (del_timer(&fq->timer)) |
280 | refcount_dec(&fq->refcnt); | 281 | refcount_dec(&fq->refcnt); |
281 | 282 | ||
282 | if (!(fq->flags & INET_FRAG_COMPLETE)) { | 283 | if (!(fq->flags & INET_FRAG_COMPLETE)) { |
283 | fq_unlink(fq, f); | 284 | fq_unlink(fq); |
284 | refcount_dec(&fq->refcnt); | 285 | refcount_dec(&fq->refcnt); |
285 | } | 286 | } |
286 | } | 287 | } |
287 | EXPORT_SYMBOL(inet_frag_kill); | 288 | EXPORT_SYMBOL(inet_frag_kill); |
288 | 289 | ||
289 | void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f) | 290 | void inet_frag_destroy(struct inet_frag_queue *q) |
290 | { | 291 | { |
291 | struct sk_buff *fp; | 292 | struct sk_buff *fp; |
292 | struct netns_frags *nf; | 293 | struct netns_frags *nf; |
293 | unsigned int sum, sum_truesize = 0; | 294 | unsigned int sum, sum_truesize = 0; |
295 | struct inet_frags *f; | ||
294 | 296 | ||
295 | WARN_ON(!(q->flags & INET_FRAG_COMPLETE)); | 297 | WARN_ON(!(q->flags & INET_FRAG_COMPLETE)); |
296 | WARN_ON(del_timer(&q->timer) != 0); | 298 | WARN_ON(del_timer(&q->timer) != 0); |
@@ -298,6 +300,7 @@ void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f) | |||
298 | /* Release all fragment data. */ | 300 | /* Release all fragment data. */ |
299 | fp = q->fragments; | 301 | fp = q->fragments; |
300 | nf = q->net; | 302 | nf = q->net; |
303 | f = nf->f; | ||
301 | while (fp) { | 304 | while (fp) { |
302 | struct sk_buff *xp = fp->next; | 305 | struct sk_buff *xp = fp->next; |
303 | 306 | ||
@@ -333,7 +336,7 @@ static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf, | |||
333 | refcount_inc(&qp->refcnt); | 336 | refcount_inc(&qp->refcnt); |
334 | spin_unlock(&hb->chain_lock); | 337 | spin_unlock(&hb->chain_lock); |
335 | qp_in->flags |= INET_FRAG_COMPLETE; | 338 | qp_in->flags |= INET_FRAG_COMPLETE; |
336 | inet_frag_put(qp_in, f); | 339 | inet_frag_put(qp_in); |
337 | return qp; | 340 | return qp; |
338 | } | 341 | } |
339 | } | 342 | } |
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index e0b39d4ecbd4..cd2b4c9419fc 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
@@ -168,7 +168,7 @@ static void ip4_frag_free(struct inet_frag_queue *q) | |||
168 | 168 | ||
169 | static void ipq_put(struct ipq *ipq) | 169 | static void ipq_put(struct ipq *ipq) |
170 | { | 170 | { |
171 | inet_frag_put(&ipq->q, &ip4_frags); | 171 | inet_frag_put(&ipq->q); |
172 | } | 172 | } |
173 | 173 | ||
174 | /* Kill ipq entry. It is not destroyed immediately, | 174 | /* Kill ipq entry. It is not destroyed immediately, |
@@ -176,7 +176,7 @@ static void ipq_put(struct ipq *ipq) | |||
176 | */ | 176 | */ |
177 | static void ipq_kill(struct ipq *ipq) | 177 | static void ipq_kill(struct ipq *ipq) |
178 | { | 178 | { |
179 | inet_frag_kill(&ipq->q, &ip4_frags); | 179 | inet_frag_kill(&ipq->q); |
180 | } | 180 | } |
181 | 181 | ||
182 | static bool frag_expire_skip_icmp(u32 user) | 182 | static bool frag_expire_skip_icmp(u32 user) |
@@ -872,20 +872,21 @@ static int __net_init ipv4_frags_init_net(struct net *net) | |||
872 | net->ipv4.frags.timeout = IP_FRAG_TIME; | 872 | net->ipv4.frags.timeout = IP_FRAG_TIME; |
873 | 873 | ||
874 | net->ipv4.frags.max_dist = 64; | 874 | net->ipv4.frags.max_dist = 64; |
875 | net->ipv4.frags.f = &ip4_frags; | ||
875 | 876 | ||
876 | res = inet_frags_init_net(&net->ipv4.frags); | 877 | res = inet_frags_init_net(&net->ipv4.frags); |
877 | if (res < 0) | 878 | if (res < 0) |
878 | return res; | 879 | return res; |
879 | res = ip4_frags_ns_ctl_register(net); | 880 | res = ip4_frags_ns_ctl_register(net); |
880 | if (res < 0) | 881 | if (res < 0) |
881 | inet_frags_exit_net(&net->ipv4.frags, &ip4_frags); | 882 | inet_frags_exit_net(&net->ipv4.frags); |
882 | return res; | 883 | return res; |
883 | } | 884 | } |
884 | 885 | ||
885 | static void __net_exit ipv4_frags_exit_net(struct net *net) | 886 | static void __net_exit ipv4_frags_exit_net(struct net *net) |
886 | { | 887 | { |
887 | ip4_frags_ns_ctl_unregister(net); | 888 | ip4_frags_ns_ctl_unregister(net); |
888 | inet_frags_exit_net(&net->ipv4.frags, &ip4_frags); | 889 | inet_frags_exit_net(&net->ipv4.frags); |
889 | } | 890 | } |
890 | 891 | ||
891 | static struct pernet_operations ip4_frags_ops = { | 892 | static struct pernet_operations ip4_frags_ops = { |
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index 6ff41569134a..c4b40fdee838 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
@@ -178,7 +178,7 @@ static void nf_ct_frag6_expire(struct timer_list *t) | |||
178 | fq = container_of(frag, struct frag_queue, q); | 178 | fq = container_of(frag, struct frag_queue, q); |
179 | net = container_of(fq->q.net, struct net, nf_frag.frags); | 179 | net = container_of(fq->q.net, struct net, nf_frag.frags); |
180 | 180 | ||
181 | ip6_expire_frag_queue(net, fq, &nf_frags); | 181 | ip6_expire_frag_queue(net, fq); |
182 | } | 182 | } |
183 | 183 | ||
184 | /* Creation primitives. */ | 184 | /* Creation primitives. */ |
@@ -264,7 +264,7 @@ static int nf_ct_frag6_queue(struct frag_queue *fq, struct sk_buff *skb, | |||
264 | * this case. -DaveM | 264 | * this case. -DaveM |
265 | */ | 265 | */ |
266 | pr_debug("end of fragment not rounded to 8 bytes.\n"); | 266 | pr_debug("end of fragment not rounded to 8 bytes.\n"); |
267 | inet_frag_kill(&fq->q, &nf_frags); | 267 | inet_frag_kill(&fq->q); |
268 | return -EPROTO; | 268 | return -EPROTO; |
269 | } | 269 | } |
270 | if (end > fq->q.len) { | 270 | if (end > fq->q.len) { |
@@ -357,7 +357,7 @@ found: | |||
357 | return 0; | 357 | return 0; |
358 | 358 | ||
359 | discard_fq: | 359 | discard_fq: |
360 | inet_frag_kill(&fq->q, &nf_frags); | 360 | inet_frag_kill(&fq->q); |
361 | err: | 361 | err: |
362 | return -EINVAL; | 362 | return -EINVAL; |
363 | } | 363 | } |
@@ -379,7 +379,7 @@ nf_ct_frag6_reasm(struct frag_queue *fq, struct sk_buff *prev, struct net_devic | |||
379 | int payload_len; | 379 | int payload_len; |
380 | u8 ecn; | 380 | u8 ecn; |
381 | 381 | ||
382 | inet_frag_kill(&fq->q, &nf_frags); | 382 | inet_frag_kill(&fq->q); |
383 | 383 | ||
384 | WARN_ON(head == NULL); | 384 | WARN_ON(head == NULL); |
385 | WARN_ON(NFCT_FRAG6_CB(head)->offset != 0); | 385 | WARN_ON(NFCT_FRAG6_CB(head)->offset != 0); |
@@ -622,7 +622,7 @@ int nf_ct_frag6_gather(struct net *net, struct sk_buff *skb, u32 user) | |||
622 | 622 | ||
623 | out_unlock: | 623 | out_unlock: |
624 | spin_unlock_bh(&fq->q.lock); | 624 | spin_unlock_bh(&fq->q.lock); |
625 | inet_frag_put(&fq->q, &nf_frags); | 625 | inet_frag_put(&fq->q); |
626 | return ret; | 626 | return ret; |
627 | } | 627 | } |
628 | EXPORT_SYMBOL_GPL(nf_ct_frag6_gather); | 628 | EXPORT_SYMBOL_GPL(nf_ct_frag6_gather); |
@@ -634,19 +634,21 @@ static int nf_ct_net_init(struct net *net) | |||
634 | net->nf_frag.frags.high_thresh = IPV6_FRAG_HIGH_THRESH; | 634 | net->nf_frag.frags.high_thresh = IPV6_FRAG_HIGH_THRESH; |
635 | net->nf_frag.frags.low_thresh = IPV6_FRAG_LOW_THRESH; | 635 | net->nf_frag.frags.low_thresh = IPV6_FRAG_LOW_THRESH; |
636 | net->nf_frag.frags.timeout = IPV6_FRAG_TIMEOUT; | 636 | net->nf_frag.frags.timeout = IPV6_FRAG_TIMEOUT; |
637 | net->nf_frag.frags.f = &nf_frags; | ||
638 | |||
637 | res = inet_frags_init_net(&net->nf_frag.frags); | 639 | res = inet_frags_init_net(&net->nf_frag.frags); |
638 | if (res < 0) | 640 | if (res < 0) |
639 | return res; | 641 | return res; |
640 | res = nf_ct_frag6_sysctl_register(net); | 642 | res = nf_ct_frag6_sysctl_register(net); |
641 | if (res < 0) | 643 | if (res < 0) |
642 | inet_frags_exit_net(&net->nf_frag.frags, &nf_frags); | 644 | inet_frags_exit_net(&net->nf_frag.frags); |
643 | return res; | 645 | return res; |
644 | } | 646 | } |
645 | 647 | ||
646 | static void nf_ct_net_exit(struct net *net) | 648 | static void nf_ct_net_exit(struct net *net) |
647 | { | 649 | { |
648 | nf_ct_frags6_sysctl_unregister(net); | 650 | nf_ct_frags6_sysctl_unregister(net); |
649 | inet_frags_exit_net(&net->nf_frag.frags, &nf_frags); | 651 | inet_frags_exit_net(&net->nf_frag.frags); |
650 | } | 652 | } |
651 | 653 | ||
652 | static struct pernet_operations nf_ct_net_ops = { | 654 | static struct pernet_operations nf_ct_net_ops = { |
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index a8f7a5f0251a..4855de6f673a 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -128,8 +128,7 @@ void ip6_frag_init(struct inet_frag_queue *q, const void *a) | |||
128 | } | 128 | } |
129 | EXPORT_SYMBOL(ip6_frag_init); | 129 | EXPORT_SYMBOL(ip6_frag_init); |
130 | 130 | ||
131 | void ip6_expire_frag_queue(struct net *net, struct frag_queue *fq, | 131 | void ip6_expire_frag_queue(struct net *net, struct frag_queue *fq) |
132 | struct inet_frags *frags) | ||
133 | { | 132 | { |
134 | struct net_device *dev = NULL; | 133 | struct net_device *dev = NULL; |
135 | 134 | ||
@@ -138,7 +137,7 @@ void ip6_expire_frag_queue(struct net *net, struct frag_queue *fq, | |||
138 | if (fq->q.flags & INET_FRAG_COMPLETE) | 137 | if (fq->q.flags & INET_FRAG_COMPLETE) |
139 | goto out; | 138 | goto out; |
140 | 139 | ||
141 | inet_frag_kill(&fq->q, frags); | 140 | inet_frag_kill(&fq->q); |
142 | 141 | ||
143 | rcu_read_lock(); | 142 | rcu_read_lock(); |
144 | dev = dev_get_by_index_rcu(net, fq->iif); | 143 | dev = dev_get_by_index_rcu(net, fq->iif); |
@@ -166,7 +165,7 @@ out_rcu_unlock: | |||
166 | rcu_read_unlock(); | 165 | rcu_read_unlock(); |
167 | out: | 166 | out: |
168 | spin_unlock(&fq->q.lock); | 167 | spin_unlock(&fq->q.lock); |
169 | inet_frag_put(&fq->q, frags); | 168 | inet_frag_put(&fq->q); |
170 | } | 169 | } |
171 | EXPORT_SYMBOL(ip6_expire_frag_queue); | 170 | EXPORT_SYMBOL(ip6_expire_frag_queue); |
172 | 171 | ||
@@ -179,7 +178,7 @@ static void ip6_frag_expire(struct timer_list *t) | |||
179 | fq = container_of(frag, struct frag_queue, q); | 178 | fq = container_of(frag, struct frag_queue, q); |
180 | net = container_of(fq->q.net, struct net, ipv6.frags); | 179 | net = container_of(fq->q.net, struct net, ipv6.frags); |
181 | 180 | ||
182 | ip6_expire_frag_queue(net, fq, &ip6_frags); | 181 | ip6_expire_frag_queue(net, fq); |
183 | } | 182 | } |
184 | 183 | ||
185 | static struct frag_queue * | 184 | static struct frag_queue * |
@@ -364,7 +363,7 @@ found: | |||
364 | return -1; | 363 | return -1; |
365 | 364 | ||
366 | discard_fq: | 365 | discard_fq: |
367 | inet_frag_kill(&fq->q, &ip6_frags); | 366 | inet_frag_kill(&fq->q); |
368 | err: | 367 | err: |
369 | __IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), | 368 | __IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), |
370 | IPSTATS_MIB_REASMFAILS); | 369 | IPSTATS_MIB_REASMFAILS); |
@@ -391,7 +390,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, | |||
391 | int sum_truesize; | 390 | int sum_truesize; |
392 | u8 ecn; | 391 | u8 ecn; |
393 | 392 | ||
394 | inet_frag_kill(&fq->q, &ip6_frags); | 393 | inet_frag_kill(&fq->q); |
395 | 394 | ||
396 | ecn = ip_frag_ecn_table[fq->ecn]; | 395 | ecn = ip_frag_ecn_table[fq->ecn]; |
397 | if (unlikely(ecn == 0xff)) | 396 | if (unlikely(ecn == 0xff)) |
@@ -569,7 +568,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb) | |||
569 | ret = ip6_frag_queue(fq, skb, fhdr, IP6CB(skb)->nhoff); | 568 | ret = ip6_frag_queue(fq, skb, fhdr, IP6CB(skb)->nhoff); |
570 | 569 | ||
571 | spin_unlock(&fq->q.lock); | 570 | spin_unlock(&fq->q.lock); |
572 | inet_frag_put(&fq->q, &ip6_frags); | 571 | inet_frag_put(&fq->q); |
573 | return ret; | 572 | return ret; |
574 | } | 573 | } |
575 | 574 | ||
@@ -716,6 +715,7 @@ static int __net_init ipv6_frags_init_net(struct net *net) | |||
716 | net->ipv6.frags.high_thresh = IPV6_FRAG_HIGH_THRESH; | 715 | net->ipv6.frags.high_thresh = IPV6_FRAG_HIGH_THRESH; |
717 | net->ipv6.frags.low_thresh = IPV6_FRAG_LOW_THRESH; | 716 | net->ipv6.frags.low_thresh = IPV6_FRAG_LOW_THRESH; |
718 | net->ipv6.frags.timeout = IPV6_FRAG_TIMEOUT; | 717 | net->ipv6.frags.timeout = IPV6_FRAG_TIMEOUT; |
718 | net->ipv6.frags.f = &ip6_frags; | ||
719 | 719 | ||
720 | res = inet_frags_init_net(&net->ipv6.frags); | 720 | res = inet_frags_init_net(&net->ipv6.frags); |
721 | if (res < 0) | 721 | if (res < 0) |
@@ -723,14 +723,14 @@ static int __net_init ipv6_frags_init_net(struct net *net) | |||
723 | 723 | ||
724 | res = ip6_frags_ns_sysctl_register(net); | 724 | res = ip6_frags_ns_sysctl_register(net); |
725 | if (res < 0) | 725 | if (res < 0) |
726 | inet_frags_exit_net(&net->ipv6.frags, &ip6_frags); | 726 | inet_frags_exit_net(&net->ipv6.frags); |
727 | return res; | 727 | return res; |
728 | } | 728 | } |
729 | 729 | ||
730 | static void __net_exit ipv6_frags_exit_net(struct net *net) | 730 | static void __net_exit ipv6_frags_exit_net(struct net *net) |
731 | { | 731 | { |
732 | ip6_frags_ns_sysctl_unregister(net); | 732 | ip6_frags_ns_sysctl_unregister(net); |
733 | inet_frags_exit_net(&net->ipv6.frags, &ip6_frags); | 733 | inet_frags_exit_net(&net->ipv6.frags); |
734 | } | 734 | } |
735 | 735 | ||
736 | static struct pernet_operations ip6_frags_ops = { | 736 | static struct pernet_operations ip6_frags_ops = { |