blob: 3b01959bf4bb0bbc208d8d564c8595c67eedd179 [file] [log] [blame]
Pavel Emelyanov7eb95152007-10-15 02:31:52 -07001/*
2 * inet fragments management
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *
9 * Authors: Pavel Emelyanov <xemul@openvz.org>
10 * Started as consolidation of ipv4/ip_fragment.c,
11 * ipv6/reassembly. and ipv6 nf conntrack reassembly
12 */
13
14#include <linux/list.h>
15#include <linux/spinlock.h>
16#include <linux/module.h>
17#include <linux/timer.h>
18#include <linux/mm.h>
Pavel Emelyanov321a3a92007-10-15 02:38:08 -070019#include <linux/random.h>
Pavel Emelyanov1e4b8282007-10-15 02:39:14 -070020#include <linux/skbuff.h>
21#include <linux/rtnetlink.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090022#include <linux/slab.h>
Pavel Emelyanov7eb95152007-10-15 02:31:52 -070023
Hannes Frederic Sowa5a3da1f2013-03-15 11:32:30 +000024#include <net/sock.h>
Pavel Emelyanov7eb95152007-10-15 02:31:52 -070025#include <net/inet_frag.h>
Hannes Frederic Sowabe991972013-03-22 08:24:37 +000026#include <net/inet_ecn.h>
27
28/* Given the OR values of all fragments, apply RFC 3168 5.3 requirements
29 * Value : 0xff if frame should be dropped.
30 * 0 or INET_ECN_CE value, to be ORed in to final iph->tos field
31 */
32const u8 ip_frag_ecn_table[16] = {
33 /* at least one fragment had CE, and others ECT_0 or ECT_1 */
34 [IPFRAG_ECN_CE | IPFRAG_ECN_ECT_0] = INET_ECN_CE,
35 [IPFRAG_ECN_CE | IPFRAG_ECN_ECT_1] = INET_ECN_CE,
36 [IPFRAG_ECN_CE | IPFRAG_ECN_ECT_0 | IPFRAG_ECN_ECT_1] = INET_ECN_CE,
37
38 /* invalid combinations : drop frame */
39 [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_CE] = 0xff,
40 [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_ECT_0] = 0xff,
41 [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_ECT_1] = 0xff,
42 [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_ECT_0 | IPFRAG_ECN_ECT_1] = 0xff,
43 [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_CE | IPFRAG_ECN_ECT_0] = 0xff,
44 [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_CE | IPFRAG_ECN_ECT_1] = 0xff,
45 [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_CE | IPFRAG_ECN_ECT_0 | IPFRAG_ECN_ECT_1] = 0xff,
46};
47EXPORT_SYMBOL(ip_frag_ecn_table);
Pavel Emelyanov7eb95152007-10-15 02:31:52 -070048
Pavel Emelyanov321a3a92007-10-15 02:38:08 -070049static void inet_frag_secret_rebuild(unsigned long dummy)
50{
51 struct inet_frags *f = (struct inet_frags *)dummy;
52 unsigned long now = jiffies;
53 int i;
54
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +000055 /* Per bucket lock NOT needed here, due to write lock protection */
Pavel Emelyanov321a3a92007-10-15 02:38:08 -070056 write_lock(&f->lock);
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +000057
Pavel Emelyanov321a3a92007-10-15 02:38:08 -070058 get_random_bytes(&f->rnd, sizeof(u32));
59 for (i = 0; i < INETFRAGS_HASHSZ; i++) {
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +000060 struct inet_frag_bucket *hb;
Pavel Emelyanov321a3a92007-10-15 02:38:08 -070061 struct inet_frag_queue *q;
Sasha Levinb67bfe02013-02-27 17:06:00 -080062 struct hlist_node *n;
Pavel Emelyanov321a3a92007-10-15 02:38:08 -070063
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +000064 hb = &f->hash[i];
65 hlist_for_each_entry_safe(q, n, &hb->chain, list) {
Pavel Emelyanov321a3a92007-10-15 02:38:08 -070066 unsigned int hval = f->hashfn(q);
67
68 if (hval != i) {
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +000069 struct inet_frag_bucket *hb_dest;
70
Pavel Emelyanov321a3a92007-10-15 02:38:08 -070071 hlist_del(&q->list);
72
73 /* Relink to new hash chain. */
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +000074 hb_dest = &f->hash[hval];
75 hlist_add_head(&q->list, &hb_dest->chain);
Pavel Emelyanov321a3a92007-10-15 02:38:08 -070076 }
77 }
78 }
79 write_unlock(&f->lock);
80
Pavel Emelyanov3b4bc4a2008-01-22 06:11:04 -080081 mod_timer(&f->secret_timer, now + f->secret_interval);
Pavel Emelyanov321a3a92007-10-15 02:38:08 -070082}
83
Pavel Emelyanov7eb95152007-10-15 02:31:52 -070084void inet_frags_init(struct inet_frags *f)
85{
86 int i;
87
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +000088 for (i = 0; i < INETFRAGS_HASHSZ; i++) {
89 struct inet_frag_bucket *hb = &f->hash[i];
Pavel Emelyanov7eb95152007-10-15 02:31:52 -070090
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +000091 spin_lock_init(&hb->chain_lock);
92 INIT_HLIST_HEAD(&hb->chain);
93 }
Pavel Emelyanov7eb95152007-10-15 02:31:52 -070094 rwlock_init(&f->lock);
95
Pavel Emelyanovb24b8a22008-01-23 21:20:07 -080096 setup_timer(&f->secret_timer, inet_frag_secret_rebuild,
97 (unsigned long)f);
Pavel Emelyanov3b4bc4a2008-01-22 06:11:04 -080098 f->secret_timer.expires = jiffies + f->secret_interval;
Pavel Emelyanov321a3a92007-10-15 02:38:08 -070099 add_timer(&f->secret_timer);
Pavel Emelyanov7eb95152007-10-15 02:31:52 -0700100}
101EXPORT_SYMBOL(inet_frags_init);
102
Pavel Emelyanove5a2bb82008-01-22 06:06:23 -0800103void inet_frags_init_net(struct netns_frags *nf)
104{
105 nf->nqueues = 0;
Jesper Dangaard Brouerd4336732013-01-28 23:45:12 +0000106 init_frag_mem_limit(nf);
Pavel Emelyanov3140c252008-01-22 06:11:48 -0800107 INIT_LIST_HEAD(&nf->lru_list);
Jesper Dangaard Brouer3ef0eb02013-01-28 23:45:51 +0000108 spin_lock_init(&nf->lru_lock);
Pavel Emelyanove5a2bb82008-01-22 06:06:23 -0800109}
110EXPORT_SYMBOL(inet_frags_init_net);
111
Pavel Emelyanov7eb95152007-10-15 02:31:52 -0700112void inet_frags_fini(struct inet_frags *f)
113{
Pavel Emelyanov321a3a92007-10-15 02:38:08 -0700114 del_timer(&f->secret_timer);
Pavel Emelyanov7eb95152007-10-15 02:31:52 -0700115}
116EXPORT_SYMBOL(inet_frags_fini);
Pavel Emelyanov277e6502007-10-15 02:37:18 -0700117
Pavel Emelyanov81566e82008-01-22 06:12:39 -0800118void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f)
119{
120 nf->low_thresh = 0;
David S. Millere8e16b702008-03-28 17:30:18 -0700121
122 local_bh_disable();
Amerigo Wang6b102862012-09-18 16:50:11 +0000123 inet_frag_evictor(nf, f, true);
David S. Millere8e16b702008-03-28 17:30:18 -0700124 local_bh_enable();
Jesper Dangaard Brouer6d7b8572013-01-28 23:45:33 +0000125
126 percpu_counter_destroy(&nf->mem);
Pavel Emelyanov81566e82008-01-22 06:12:39 -0800127}
128EXPORT_SYMBOL(inet_frags_exit_net);
129
Pavel Emelyanov277e6502007-10-15 02:37:18 -0700130static inline void fq_unlink(struct inet_frag_queue *fq, struct inet_frags *f)
131{
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +0000132 struct inet_frag_bucket *hb;
133 unsigned int hash;
134
135 read_lock(&f->lock);
136 hash = f->hashfn(fq);
137 hb = &f->hash[hash];
138
139 spin_lock(&hb->chain_lock);
Pavel Emelyanov277e6502007-10-15 02:37:18 -0700140 hlist_del(&fq->list);
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +0000141 spin_unlock(&hb->chain_lock);
142
143 read_unlock(&f->lock);
Jesper Dangaard Brouer3ef0eb02013-01-28 23:45:51 +0000144 inet_frag_lru_del(fq);
Pavel Emelyanov277e6502007-10-15 02:37:18 -0700145}
146
147void inet_frag_kill(struct inet_frag_queue *fq, struct inet_frags *f)
148{
149 if (del_timer(&fq->timer))
150 atomic_dec(&fq->refcnt);
151
Joe Perchesbc578a52008-03-28 16:35:27 -0700152 if (!(fq->last_in & INET_FRAG_COMPLETE)) {
Pavel Emelyanov277e6502007-10-15 02:37:18 -0700153 fq_unlink(fq, f);
154 atomic_dec(&fq->refcnt);
Joe Perchesbc578a52008-03-28 16:35:27 -0700155 fq->last_in |= INET_FRAG_COMPLETE;
Pavel Emelyanov277e6502007-10-15 02:37:18 -0700156 }
157}
Pavel Emelyanov277e6502007-10-15 02:37:18 -0700158EXPORT_SYMBOL(inet_frag_kill);
Pavel Emelyanov1e4b8282007-10-15 02:39:14 -0700159
Pavel Emelyanov6ddc0822008-01-22 06:07:25 -0800160static inline void frag_kfree_skb(struct netns_frags *nf, struct inet_frags *f,
Jesper Dangaard Brouerd4336732013-01-28 23:45:12 +0000161 struct sk_buff *skb)
Pavel Emelyanov1e4b8282007-10-15 02:39:14 -0700162{
Pavel Emelyanov1e4b8282007-10-15 02:39:14 -0700163 if (f->skb_free)
164 f->skb_free(skb);
165 kfree_skb(skb);
166}
167
168void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f,
169 int *work)
170{
171 struct sk_buff *fp;
Pavel Emelyanov6ddc0822008-01-22 06:07:25 -0800172 struct netns_frags *nf;
Jesper Dangaard Brouerd4336732013-01-28 23:45:12 +0000173 unsigned int sum, sum_truesize = 0;
Pavel Emelyanov1e4b8282007-10-15 02:39:14 -0700174
Ilpo Järvinen547b7922008-07-25 21:43:18 -0700175 WARN_ON(!(q->last_in & INET_FRAG_COMPLETE));
176 WARN_ON(del_timer(&q->timer) != 0);
Pavel Emelyanov1e4b8282007-10-15 02:39:14 -0700177
178 /* Release all fragment data. */
179 fp = q->fragments;
Pavel Emelyanov6ddc0822008-01-22 06:07:25 -0800180 nf = q->net;
Pavel Emelyanov1e4b8282007-10-15 02:39:14 -0700181 while (fp) {
182 struct sk_buff *xp = fp->next;
183
Jesper Dangaard Brouerd4336732013-01-28 23:45:12 +0000184 sum_truesize += fp->truesize;
185 frag_kfree_skb(nf, f, fp);
Pavel Emelyanov1e4b8282007-10-15 02:39:14 -0700186 fp = xp;
187 }
Jesper Dangaard Brouerd4336732013-01-28 23:45:12 +0000188 sum = sum_truesize + f->qsize;
Pavel Emelyanov1e4b8282007-10-15 02:39:14 -0700189 if (work)
Jesper Dangaard Brouerd4336732013-01-28 23:45:12 +0000190 *work -= sum;
191 sub_frag_mem_limit(q, sum);
Pavel Emelyanov1e4b8282007-10-15 02:39:14 -0700192
Pavel Emelyanovc9547702007-10-17 19:48:26 -0700193 if (f->destructor)
194 f->destructor(q);
195 kfree(q);
Pavel Emelyanov1e4b8282007-10-15 02:39:14 -0700196
197}
198EXPORT_SYMBOL(inet_frag_destroy);
Pavel Emelyanov8e7999c2007-10-15 02:40:06 -0700199
Amerigo Wang6b102862012-09-18 16:50:11 +0000200int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f, bool force)
Pavel Emelyanov8e7999c2007-10-15 02:40:06 -0700201{
202 struct inet_frag_queue *q;
203 int work, evicted = 0;
204
Amerigo Wang6b102862012-09-18 16:50:11 +0000205 if (!force) {
Jesper Dangaard Brouerd4336732013-01-28 23:45:12 +0000206 if (frag_mem_limit(nf) <= nf->high_thresh)
Amerigo Wang6b102862012-09-18 16:50:11 +0000207 return 0;
208 }
209
Jesper Dangaard Brouerd4336732013-01-28 23:45:12 +0000210 work = frag_mem_limit(nf) - nf->low_thresh;
Florian Westphale588e2f2014-03-06 18:06:41 +0100211 while (work > 0 || force) {
Jesper Dangaard Brouer3ef0eb02013-01-28 23:45:51 +0000212 spin_lock(&nf->lru_lock);
213
Pavel Emelyanov3140c252008-01-22 06:11:48 -0800214 if (list_empty(&nf->lru_list)) {
Jesper Dangaard Brouer3ef0eb02013-01-28 23:45:51 +0000215 spin_unlock(&nf->lru_lock);
Pavel Emelyanov8e7999c2007-10-15 02:40:06 -0700216 break;
217 }
218
Pavel Emelyanov3140c252008-01-22 06:11:48 -0800219 q = list_first_entry(&nf->lru_list,
Pavel Emelyanov8e7999c2007-10-15 02:40:06 -0700220 struct inet_frag_queue, lru_list);
221 atomic_inc(&q->refcnt);
Jesper Dangaard Brouer68399ac2013-03-27 05:55:25 +0000222 /* Remove q from list to avoid several CPUs grabbing it */
223 list_del_init(&q->lru_list);
224
Jesper Dangaard Brouer3ef0eb02013-01-28 23:45:51 +0000225 spin_unlock(&nf->lru_lock);
Pavel Emelyanov8e7999c2007-10-15 02:40:06 -0700226
227 spin_lock(&q->lock);
Joe Perchesbc578a52008-03-28 16:35:27 -0700228 if (!(q->last_in & INET_FRAG_COMPLETE))
Pavel Emelyanov8e7999c2007-10-15 02:40:06 -0700229 inet_frag_kill(q, f);
230 spin_unlock(&q->lock);
231
232 if (atomic_dec_and_test(&q->refcnt))
233 inet_frag_destroy(q, f, &work);
234 evicted++;
235 }
236
237 return evicted;
238}
239EXPORT_SYMBOL(inet_frag_evictor);
Pavel Emelyanov2588fe12007-10-17 19:44:34 -0700240
Pavel Emelyanovac18e752008-01-22 06:02:14 -0800241static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf,
242 struct inet_frag_queue *qp_in, struct inet_frags *f,
Pavel Emelyanov9a375802008-06-27 20:06:08 -0700243 void *arg)
Pavel Emelyanov2588fe12007-10-17 19:44:34 -0700244{
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +0000245 struct inet_frag_bucket *hb;
Pavel Emelyanov2588fe12007-10-17 19:44:34 -0700246 struct inet_frag_queue *qp;
Pavel Emelyanov9a375802008-06-27 20:06:08 -0700247 unsigned int hash;
Pavel Emelyanov2588fe12007-10-17 19:44:34 -0700248
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +0000249 read_lock(&f->lock); /* Protects against hash rebuild */
Pavel Emelyanov9a375802008-06-27 20:06:08 -0700250 /*
251 * While we stayed w/o the lock other CPU could update
252 * the rnd seed, so we need to re-calculate the hash
253 * chain. Fortunatelly the qp_in can be used to get one.
254 */
255 hash = f->hashfn(qp_in);
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +0000256 hb = &f->hash[hash];
257 spin_lock(&hb->chain_lock);
258
Pavel Emelyanov2588fe12007-10-17 19:44:34 -0700259#ifdef CONFIG_SMP
260 /* With SMP race we have to recheck hash table, because
261 * such entry could be created on other cpu, while we
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +0000262 * released the hash bucket lock.
Pavel Emelyanov2588fe12007-10-17 19:44:34 -0700263 */
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +0000264 hlist_for_each_entry(qp, &hb->chain, list) {
Pavel Emelyanovac18e752008-01-22 06:02:14 -0800265 if (qp->net == nf && f->match(qp, arg)) {
Pavel Emelyanov2588fe12007-10-17 19:44:34 -0700266 atomic_inc(&qp->refcnt);
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +0000267 spin_unlock(&hb->chain_lock);
268 read_unlock(&f->lock);
Joe Perchesbc578a52008-03-28 16:35:27 -0700269 qp_in->last_in |= INET_FRAG_COMPLETE;
Pavel Emelyanov2588fe12007-10-17 19:44:34 -0700270 inet_frag_put(qp_in, f);
271 return qp;
272 }
273 }
274#endif
275 qp = qp_in;
Pavel Emelyanovb2fd5322008-01-22 06:09:37 -0800276 if (!mod_timer(&qp->timer, jiffies + nf->timeout))
Pavel Emelyanov2588fe12007-10-17 19:44:34 -0700277 atomic_inc(&qp->refcnt);
278
279 atomic_inc(&qp->refcnt);
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +0000280 hlist_add_head(&qp->list, &hb->chain);
Nikolay Aleksandrov24b9bf42014-03-03 23:19:18 +0100281 inet_frag_lru_add(nf, qp);
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +0000282 spin_unlock(&hb->chain_lock);
283 read_unlock(&f->lock);
Nikolay Aleksandrov24b9bf42014-03-03 23:19:18 +0100284
Pavel Emelyanov2588fe12007-10-17 19:44:34 -0700285 return qp;
286}
Pavel Emelyanove521db92007-10-17 19:45:23 -0700287
Pavel Emelyanovac18e752008-01-22 06:02:14 -0800288static struct inet_frag_queue *inet_frag_alloc(struct netns_frags *nf,
289 struct inet_frags *f, void *arg)
Pavel Emelyanove521db92007-10-17 19:45:23 -0700290{
291 struct inet_frag_queue *q;
292
293 q = kzalloc(f->qsize, GFP_ATOMIC);
294 if (q == NULL)
295 return NULL;
296
Gao feng54db0cc2012-06-08 01:21:40 +0000297 q->net = nf;
Pavel Emelyanovc6fda282007-10-17 19:46:47 -0700298 f->constructor(q, arg);
Jesper Dangaard Brouerd4336732013-01-28 23:45:12 +0000299 add_frag_mem_limit(q, f->qsize);
300
Pavel Emelyanove521db92007-10-17 19:45:23 -0700301 setup_timer(&q->timer, f->frag_expire, (unsigned long)q);
302 spin_lock_init(&q->lock);
303 atomic_set(&q->refcnt, 1);
Konstantin Khlebnikovb56141a2013-05-05 04:56:22 +0000304 INIT_LIST_HEAD(&q->lru_list);
Pavel Emelyanove521db92007-10-17 19:45:23 -0700305
306 return q;
307}
Pavel Emelyanovc6fda282007-10-17 19:46:47 -0700308
Pavel Emelyanovac18e752008-01-22 06:02:14 -0800309static struct inet_frag_queue *inet_frag_create(struct netns_frags *nf,
Pavel Emelyanov9a375802008-06-27 20:06:08 -0700310 struct inet_frags *f, void *arg)
Pavel Emelyanovc6fda282007-10-17 19:46:47 -0700311{
312 struct inet_frag_queue *q;
313
Pavel Emelyanovac18e752008-01-22 06:02:14 -0800314 q = inet_frag_alloc(nf, f, arg);
Pavel Emelyanovc6fda282007-10-17 19:46:47 -0700315 if (q == NULL)
316 return NULL;
317
Pavel Emelyanov9a375802008-06-27 20:06:08 -0700318 return inet_frag_intern(nf, q, f, arg);
Pavel Emelyanovc6fda282007-10-17 19:46:47 -0700319}
Pavel Emelyanovabd65232007-10-17 19:47:21 -0700320
Pavel Emelyanovac18e752008-01-22 06:02:14 -0800321struct inet_frag_queue *inet_frag_find(struct netns_frags *nf,
322 struct inet_frags *f, void *key, unsigned int hash)
Hannes Eder56bca312009-02-25 10:32:52 +0000323 __releases(&f->lock)
Pavel Emelyanovabd65232007-10-17 19:47:21 -0700324{
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +0000325 struct inet_frag_bucket *hb;
Pavel Emelyanovabd65232007-10-17 19:47:21 -0700326 struct inet_frag_queue *q;
Hannes Frederic Sowa5a3da1f2013-03-15 11:32:30 +0000327 int depth = 0;
Pavel Emelyanovabd65232007-10-17 19:47:21 -0700328
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +0000329 hb = &f->hash[hash];
330
331 spin_lock(&hb->chain_lock);
332 hlist_for_each_entry(q, &hb->chain, list) {
Pavel Emelyanovac18e752008-01-22 06:02:14 -0800333 if (q->net == nf && f->match(q, key)) {
Pavel Emelyanovabd65232007-10-17 19:47:21 -0700334 atomic_inc(&q->refcnt);
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +0000335 spin_unlock(&hb->chain_lock);
Pavel Emelyanovabd65232007-10-17 19:47:21 -0700336 read_unlock(&f->lock);
337 return q;
338 }
Hannes Frederic Sowa5a3da1f2013-03-15 11:32:30 +0000339 depth++;
Pavel Emelyanovabd65232007-10-17 19:47:21 -0700340 }
Jesper Dangaard Brouer19952cc42013-04-03 23:38:16 +0000341 spin_unlock(&hb->chain_lock);
Pavel Emelyanovabd65232007-10-17 19:47:21 -0700342 read_unlock(&f->lock);
343
Hannes Frederic Sowa5a3da1f2013-03-15 11:32:30 +0000344 if (depth <= INETFRAGS_MAXDEPTH)
345 return inet_frag_create(nf, f, key);
346 else
347 return ERR_PTR(-ENOBUFS);
Pavel Emelyanovabd65232007-10-17 19:47:21 -0700348}
349EXPORT_SYMBOL(inet_frag_find);
Hannes Frederic Sowa5a3da1f2013-03-15 11:32:30 +0000350
351void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q,
352 const char *prefix)
353{
354 static const char msg[] = "inet_frag_find: Fragment hash bucket"
355 " list length grew over limit " __stringify(INETFRAGS_MAXDEPTH)
356 ". Dropping fragment.\n";
357
358 if (PTR_ERR(q) == -ENOBUFS)
359 LIMIT_NETDEBUG(KERN_WARNING "%s%s", prefix, msg);
360}
361EXPORT_SYMBOL(inet_frag_maybe_warn_overflow);