2 * IPv6 fragment reassembly for connection tracking
4 * Copyright (C)2004 USAGI/WIDE Project
7 * Yasuyuki Kozakai @USAGI <yasuyuki.kozakai@toshiba.co.jp>
9 * Based on: net/ipv6/reassembly.c
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
17 #include <linux/errno.h>
18 #include <linux/types.h>
19 #include <linux/string.h>
20 #include <linux/socket.h>
21 #include <linux/sockios.h>
22 #include <linux/jiffies.h>
23 #include <linux/net.h>
24 #include <linux/list.h>
25 #include <linux/netdevice.h>
26 #include <linux/in6.h>
27 #include <linux/ipv6.h>
28 #include <linux/icmpv6.h>
29 #include <linux/random.h>
30 #include <linux/jhash.h>
34 #include <net/inet_frag.h>
37 #include <net/protocol.h>
38 #include <net/transp_v6.h>
39 #include <net/rawv6.h>
40 #include <net/ndisc.h>
41 #include <net/addrconf.h>
42 #include <linux/sysctl.h>
43 #include <linux/netfilter.h>
44 #include <linux/netfilter_ipv6.h>
45 #include <linux/kernel.h>
46 #include <linux/module.h>
48 #define NF_CT_FRAG6_HIGH_THRESH 262144 /* == 256*1024 */
49 #define NF_CT_FRAG6_LOW_THRESH 196608 /* == 192*1024 */
50 #define NF_CT_FRAG6_TIMEOUT IPV6_FRAG_TIMEOUT
52 unsigned int nf_ct_frag6_high_thresh __read_mostly = 256*1024;
53 unsigned int nf_ct_frag6_low_thresh __read_mostly = 192*1024;
54 unsigned long nf_ct_frag6_timeout __read_mostly = IPV6_FRAG_TIMEOUT;
56 struct nf_ct_frag6_skb_cb
58 struct inet6_skb_parm h;
63 #define NFCT_FRAG6_CB(skb) ((struct nf_ct_frag6_skb_cb*)((skb)->cb))
65 struct nf_ct_frag6_queue
67 struct inet_frag_queue q;
69 __be32 id; /* fragment id */
70 struct in6_addr saddr;
71 struct in6_addr daddr;
79 #define FRAG6Q_HASHSZ 64
81 static struct hlist_head nf_ct_frag6_hash[FRAG6Q_HASHSZ];
82 static DEFINE_RWLOCK(nf_ct_frag6_lock);
83 static u32 nf_ct_frag6_hash_rnd;
84 static LIST_HEAD(nf_ct_frag6_lru_list);
85 int nf_ct_frag6_nqueues = 0;
87 static __inline__ void __fq_unlink(struct nf_ct_frag6_queue *fq)
89 hlist_del(&fq->q.list);
90 list_del(&fq->q.lru_list);
91 nf_ct_frag6_nqueues--;
94 static __inline__ void fq_unlink(struct nf_ct_frag6_queue *fq)
96 write_lock(&nf_ct_frag6_lock);
98 write_unlock(&nf_ct_frag6_lock);
101 static unsigned int ip6qhashfn(__be32 id, struct in6_addr *saddr,
102 struct in6_addr *daddr)
106 a = (__force u32)saddr->s6_addr32[0];
107 b = (__force u32)saddr->s6_addr32[1];
108 c = (__force u32)saddr->s6_addr32[2];
110 a += JHASH_GOLDEN_RATIO;
111 b += JHASH_GOLDEN_RATIO;
112 c += nf_ct_frag6_hash_rnd;
113 __jhash_mix(a, b, c);
115 a += (__force u32)saddr->s6_addr32[3];
116 b += (__force u32)daddr->s6_addr32[0];
117 c += (__force u32)daddr->s6_addr32[1];
118 __jhash_mix(a, b, c);
120 a += (__force u32)daddr->s6_addr32[2];
121 b += (__force u32)daddr->s6_addr32[3];
122 c += (__force u32)id;
123 __jhash_mix(a, b, c);
125 return c & (FRAG6Q_HASHSZ - 1);
128 static struct timer_list nf_ct_frag6_secret_timer;
129 int nf_ct_frag6_secret_interval = 10 * 60 * HZ;
131 static void nf_ct_frag6_secret_rebuild(unsigned long dummy)
133 unsigned long now = jiffies;
136 write_lock(&nf_ct_frag6_lock);
137 get_random_bytes(&nf_ct_frag6_hash_rnd, sizeof(u32));
138 for (i = 0; i < FRAG6Q_HASHSZ; i++) {
139 struct nf_ct_frag6_queue *q;
140 struct hlist_node *p, *n;
142 hlist_for_each_entry_safe(q, p, n, &nf_ct_frag6_hash[i], q.list) {
143 unsigned int hval = ip6qhashfn(q->id,
147 hlist_del(&q->q.list);
148 /* Relink to new hash chain. */
149 hlist_add_head(&q->q.list,
150 &nf_ct_frag6_hash[hval]);
154 write_unlock(&nf_ct_frag6_lock);
156 mod_timer(&nf_ct_frag6_secret_timer, now + nf_ct_frag6_secret_interval);
159 atomic_t nf_ct_frag6_mem = ATOMIC_INIT(0);
161 /* Memory Tracking Functions. */
162 static inline void frag_kfree_skb(struct sk_buff *skb, unsigned int *work)
165 *work -= skb->truesize;
166 atomic_sub(skb->truesize, &nf_ct_frag6_mem);
167 if (NFCT_FRAG6_CB(skb)->orig)
168 kfree_skb(NFCT_FRAG6_CB(skb)->orig);
173 static inline void frag_free_queue(struct nf_ct_frag6_queue *fq,
177 *work -= sizeof(struct nf_ct_frag6_queue);
178 atomic_sub(sizeof(struct nf_ct_frag6_queue), &nf_ct_frag6_mem);
182 static inline struct nf_ct_frag6_queue *frag_alloc_queue(void)
184 struct nf_ct_frag6_queue *fq = kmalloc(sizeof(struct nf_ct_frag6_queue), GFP_ATOMIC);
188 atomic_add(sizeof(struct nf_ct_frag6_queue), &nf_ct_frag6_mem);
192 /* Destruction primitives. */
194 /* Complete destruction of fq. */
195 static void nf_ct_frag6_destroy(struct nf_ct_frag6_queue *fq,
200 BUG_TRAP(fq->q.last_in&COMPLETE);
201 BUG_TRAP(del_timer(&fq->q.timer) == 0);
203 /* Release all fragment data. */
204 fp = fq->q.fragments;
206 struct sk_buff *xp = fp->next;
208 frag_kfree_skb(fp, work);
212 frag_free_queue(fq, work);
215 static __inline__ void fq_put(struct nf_ct_frag6_queue *fq, unsigned int *work)
217 if (atomic_dec_and_test(&fq->q.refcnt))
218 nf_ct_frag6_destroy(fq, work);
221 /* Kill fq entry. It is not destroyed immediately,
222 * because caller (and someone more) holds reference count.
224 static __inline__ void fq_kill(struct nf_ct_frag6_queue *fq)
226 if (del_timer(&fq->q.timer))
227 atomic_dec(&fq->q.refcnt);
229 if (!(fq->q.last_in & COMPLETE)) {
231 atomic_dec(&fq->q.refcnt);
232 fq->q.last_in |= COMPLETE;
236 static void nf_ct_frag6_evictor(void)
238 struct nf_ct_frag6_queue *fq;
239 struct list_head *tmp;
242 work = atomic_read(&nf_ct_frag6_mem);
243 if (work <= nf_ct_frag6_low_thresh)
246 work -= nf_ct_frag6_low_thresh;
248 read_lock(&nf_ct_frag6_lock);
249 if (list_empty(&nf_ct_frag6_lru_list)) {
250 read_unlock(&nf_ct_frag6_lock);
253 tmp = nf_ct_frag6_lru_list.next;
255 fq = list_entry(tmp, struct nf_ct_frag6_queue, q.lru_list);
256 atomic_inc(&fq->q.refcnt);
257 read_unlock(&nf_ct_frag6_lock);
259 spin_lock(&fq->q.lock);
260 if (!(fq->q.last_in&COMPLETE))
262 spin_unlock(&fq->q.lock);
268 static void nf_ct_frag6_expire(unsigned long data)
270 struct nf_ct_frag6_queue *fq = (struct nf_ct_frag6_queue *) data;
272 spin_lock(&fq->q.lock);
274 if (fq->q.last_in & COMPLETE)
280 spin_unlock(&fq->q.lock);
284 /* Creation primitives. */
286 static struct nf_ct_frag6_queue *nf_ct_frag6_intern(unsigned int hash,
287 struct nf_ct_frag6_queue *fq_in)
289 struct nf_ct_frag6_queue *fq;
291 struct hlist_node *n;
294 write_lock(&nf_ct_frag6_lock);
296 hlist_for_each_entry(fq, n, &nf_ct_frag6_hash[hash], q.list) {
297 if (fq->id == fq_in->id &&
298 ipv6_addr_equal(&fq_in->saddr, &fq->saddr) &&
299 ipv6_addr_equal(&fq_in->daddr, &fq->daddr)) {
300 atomic_inc(&fq->q.refcnt);
301 write_unlock(&nf_ct_frag6_lock);
302 fq_in->q.last_in |= COMPLETE;
310 if (!mod_timer(&fq->q.timer, jiffies + nf_ct_frag6_timeout))
311 atomic_inc(&fq->q.refcnt);
313 atomic_inc(&fq->q.refcnt);
314 hlist_add_head(&fq->q.list, &nf_ct_frag6_hash[hash]);
315 INIT_LIST_HEAD(&fq->q.lru_list);
316 list_add_tail(&fq->q.lru_list, &nf_ct_frag6_lru_list);
317 nf_ct_frag6_nqueues++;
318 write_unlock(&nf_ct_frag6_lock);
323 static struct nf_ct_frag6_queue *
324 nf_ct_frag6_create(unsigned int hash, __be32 id, struct in6_addr *src, struct in6_addr *dst)
326 struct nf_ct_frag6_queue *fq;
328 if ((fq = frag_alloc_queue()) == NULL) {
329 pr_debug("Can't alloc new queue\n");
333 memset(fq, 0, sizeof(struct nf_ct_frag6_queue));
336 ipv6_addr_copy(&fq->saddr, src);
337 ipv6_addr_copy(&fq->daddr, dst);
339 setup_timer(&fq->q.timer, nf_ct_frag6_expire, (unsigned long)fq);
340 spin_lock_init(&fq->q.lock);
341 atomic_set(&fq->q.refcnt, 1);
343 return nf_ct_frag6_intern(hash, fq);
349 static __inline__ struct nf_ct_frag6_queue *
350 fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst)
352 struct nf_ct_frag6_queue *fq;
353 struct hlist_node *n;
354 unsigned int hash = ip6qhashfn(id, src, dst);
356 read_lock(&nf_ct_frag6_lock);
357 hlist_for_each_entry(fq, n, &nf_ct_frag6_hash[hash], q.list) {
359 ipv6_addr_equal(src, &fq->saddr) &&
360 ipv6_addr_equal(dst, &fq->daddr)) {
361 atomic_inc(&fq->q.refcnt);
362 read_unlock(&nf_ct_frag6_lock);
366 read_unlock(&nf_ct_frag6_lock);
368 return nf_ct_frag6_create(hash, id, src, dst);
372 static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
373 struct frag_hdr *fhdr, int nhoff)
375 struct sk_buff *prev, *next;
378 if (fq->q.last_in & COMPLETE) {
379 pr_debug("Allready completed\n");
383 offset = ntohs(fhdr->frag_off) & ~0x7;
384 end = offset + (ntohs(ipv6_hdr(skb)->payload_len) -
385 ((u8 *)(fhdr + 1) - (u8 *)(ipv6_hdr(skb) + 1)));
387 if ((unsigned int)end > IPV6_MAXPLEN) {
388 pr_debug("offset is too large.\n");
392 if (skb->ip_summed == CHECKSUM_COMPLETE) {
393 const unsigned char *nh = skb_network_header(skb);
394 skb->csum = csum_sub(skb->csum,
395 csum_partial(nh, (u8 *)(fhdr + 1) - nh,
399 /* Is this the final fragment? */
400 if (!(fhdr->frag_off & htons(IP6_MF))) {
401 /* If we already have some bits beyond end
402 * or have different end, the segment is corrupted.
404 if (end < fq->q.len ||
405 ((fq->q.last_in & LAST_IN) && end != fq->q.len)) {
406 pr_debug("already received last fragment\n");
409 fq->q.last_in |= LAST_IN;
412 /* Check if the fragment is rounded to 8 bytes.
413 * Required by the RFC.
416 /* RFC2460 says always send parameter problem in
419 pr_debug("end of fragment not rounded to 8 bytes.\n");
422 if (end > fq->q.len) {
423 /* Some bits beyond end -> corruption. */
424 if (fq->q.last_in & LAST_IN) {
425 pr_debug("last packet already reached.\n");
435 /* Point into the IP datagram 'data' part. */
436 if (!pskb_pull(skb, (u8 *) (fhdr + 1) - skb->data)) {
437 pr_debug("queue: message is too short.\n");
440 if (pskb_trim_rcsum(skb, end - offset)) {
441 pr_debug("Can't trim\n");
445 /* Find out which fragments are in front and at the back of us
446 * in the chain of fragments so far. We must know where to put
447 * this fragment, right?
450 for (next = fq->q.fragments; next != NULL; next = next->next) {
451 if (NFCT_FRAG6_CB(next)->offset >= offset)
456 /* We found where to put this one. Check for overlap with
457 * preceding fragment, and, if needed, align things so that
458 * any overlaps are eliminated.
461 int i = (NFCT_FRAG6_CB(prev)->offset + prev->len) - offset;
466 pr_debug("overlap\n");
469 if (!pskb_pull(skb, i)) {
470 pr_debug("Can't pull\n");
473 if (skb->ip_summed != CHECKSUM_UNNECESSARY)
474 skb->ip_summed = CHECKSUM_NONE;
478 /* Look for overlap with succeeding segments.
479 * If we can merge fragments, do it.
481 while (next && NFCT_FRAG6_CB(next)->offset < end) {
482 /* overlap is 'i' bytes */
483 int i = end - NFCT_FRAG6_CB(next)->offset;
486 /* Eat head of the next overlapped fragment
487 * and leave the loop. The next ones cannot overlap.
489 pr_debug("Eat head of the overlapped parts.: %d", i);
490 if (!pskb_pull(next, i))
494 NFCT_FRAG6_CB(next)->offset += i;
496 if (next->ip_summed != CHECKSUM_UNNECESSARY)
497 next->ip_summed = CHECKSUM_NONE;
500 struct sk_buff *free_it = next;
502 /* Old fragmnet is completely overridden with
510 fq->q.fragments = next;
512 fq->q.meat -= free_it->len;
513 frag_kfree_skb(free_it, NULL);
517 NFCT_FRAG6_CB(skb)->offset = offset;
519 /* Insert this fragment in the chain of fragments. */
524 fq->q.fragments = skb;
527 fq->q.stamp = skb->tstamp;
528 fq->q.meat += skb->len;
529 atomic_add(skb->truesize, &nf_ct_frag6_mem);
531 /* The first fragment.
532 * nhoffset is obtained from the first fragment, of course.
535 fq->nhoffset = nhoff;
536 fq->q.last_in |= FIRST_IN;
538 write_lock(&nf_ct_frag6_lock);
539 list_move_tail(&fq->q.lru_list, &nf_ct_frag6_lru_list);
540 write_unlock(&nf_ct_frag6_lock);
548 * Check if this packet is complete.
549 * Returns NULL on failure by any reason, and pointer
550 * to current nexthdr field in reassembled frame.
552 * It is called with locked fq, and caller must check that
553 * queue is eligible for reassembly i.e. it is not COMPLETE,
554 * the last and the first frames arrived and all the bits are here.
556 static struct sk_buff *
557 nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
559 struct sk_buff *fp, *op, *head = fq->q.fragments;
564 BUG_TRAP(head != NULL);
565 BUG_TRAP(NFCT_FRAG6_CB(head)->offset == 0);
567 /* Unfragmented part is taken from the first segment. */
568 payload_len = ((head->data - skb_network_header(head)) -
569 sizeof(struct ipv6hdr) + fq->q.len -
570 sizeof(struct frag_hdr));
571 if (payload_len > IPV6_MAXPLEN) {
572 pr_debug("payload len is too large.\n");
576 /* Head of list must not be cloned. */
577 if (skb_cloned(head) && pskb_expand_head(head, 0, 0, GFP_ATOMIC)) {
578 pr_debug("skb is cloned but can't expand head");
582 /* If the first fragment is fragmented itself, we split
583 * it to two chunks: the first with data and paged part
584 * and the second, holding only fragments. */
585 if (skb_shinfo(head)->frag_list) {
586 struct sk_buff *clone;
589 if ((clone = alloc_skb(0, GFP_ATOMIC)) == NULL) {
590 pr_debug("Can't alloc skb\n");
593 clone->next = head->next;
595 skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list;
596 skb_shinfo(head)->frag_list = NULL;
597 for (i=0; i<skb_shinfo(head)->nr_frags; i++)
598 plen += skb_shinfo(head)->frags[i].size;
599 clone->len = clone->data_len = head->data_len - plen;
600 head->data_len -= clone->len;
601 head->len -= clone->len;
603 clone->ip_summed = head->ip_summed;
605 NFCT_FRAG6_CB(clone)->orig = NULL;
606 atomic_add(clone->truesize, &nf_ct_frag6_mem);
609 /* We have to remove fragment header from datagram and to relocate
610 * header in order to calculate ICV correctly. */
611 skb_network_header(head)[fq->nhoffset] = skb_transport_header(head)[0];
612 memmove(head->head + sizeof(struct frag_hdr), head->head,
613 (head->data - head->head) - sizeof(struct frag_hdr));
614 head->mac_header += sizeof(struct frag_hdr);
615 head->network_header += sizeof(struct frag_hdr);
617 skb_shinfo(head)->frag_list = head->next;
618 skb_reset_transport_header(head);
619 skb_push(head, head->data - skb_network_header(head));
620 atomic_sub(head->truesize, &nf_ct_frag6_mem);
622 for (fp=head->next; fp; fp = fp->next) {
623 head->data_len += fp->len;
624 head->len += fp->len;
625 if (head->ip_summed != fp->ip_summed)
626 head->ip_summed = CHECKSUM_NONE;
627 else if (head->ip_summed == CHECKSUM_COMPLETE)
628 head->csum = csum_add(head->csum, fp->csum);
629 head->truesize += fp->truesize;
630 atomic_sub(fp->truesize, &nf_ct_frag6_mem);
635 head->tstamp = fq->q.stamp;
636 ipv6_hdr(head)->payload_len = htons(payload_len);
638 /* Yes, and fold redundant checksum back. 8) */
639 if (head->ip_summed == CHECKSUM_COMPLETE)
640 head->csum = csum_partial(skb_network_header(head),
641 skb_network_header_len(head),
644 fq->q.fragments = NULL;
646 /* all original skbs are linked into the NFCT_FRAG6_CB(head).orig */
647 fp = skb_shinfo(head)->frag_list;
648 if (NFCT_FRAG6_CB(fp)->orig == NULL)
649 /* at above code, head skb is divided into two skbs. */
652 op = NFCT_FRAG6_CB(head)->orig;
653 for (; fp; fp = fp->next) {
654 struct sk_buff *orig = NFCT_FRAG6_CB(fp)->orig;
658 NFCT_FRAG6_CB(fp)->orig = NULL;
665 printk(KERN_DEBUG "nf_ct_frag6_reasm: payload len = %d\n", payload_len);
669 printk(KERN_DEBUG "nf_ct_frag6_reasm: no memory for reassembly\n");
675 * find the header just before Fragment Header.
677 * if success return 0 and set ...
678 * (*prevhdrp): the value of "Next Header Field" in the header
679 * just before Fragment Header.
680 * (*prevhoff): the offset of "Next Header Field" in the header
681 * just before Fragment Header.
682 * (*fhoff) : the offset of Fragment Header.
684 * Based on ipv6_skip_hdr() in net/ipv6/exthdr.c
688 find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff)
690 u8 nexthdr = ipv6_hdr(skb)->nexthdr;
691 const int netoff = skb_network_offset(skb);
692 u8 prev_nhoff = netoff + offsetof(struct ipv6hdr, nexthdr);
693 int start = netoff + sizeof(struct ipv6hdr);
694 int len = skb->len - start;
695 u8 prevhdr = NEXTHDR_IPV6;
697 while (nexthdr != NEXTHDR_FRAGMENT) {
698 struct ipv6_opt_hdr hdr;
701 if (!ipv6_ext_hdr(nexthdr)) {
704 if (len < (int)sizeof(struct ipv6_opt_hdr)) {
705 pr_debug("too short\n");
708 if (nexthdr == NEXTHDR_NONE) {
709 pr_debug("next header is none\n");
712 if (skb_copy_bits(skb, start, &hdr, sizeof(hdr)))
714 if (nexthdr == NEXTHDR_AUTH)
715 hdrlen = (hdr.hdrlen+2)<<2;
717 hdrlen = ipv6_optlen(&hdr);
722 nexthdr = hdr.nexthdr;
731 *prevhoff = prev_nhoff;
737 struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb)
739 struct sk_buff *clone;
740 struct net_device *dev = skb->dev;
741 struct frag_hdr *fhdr;
742 struct nf_ct_frag6_queue *fq;
746 struct sk_buff *ret_skb = NULL;
748 /* Jumbo payload inhibits frag. header */
749 if (ipv6_hdr(skb)->payload_len == 0) {
750 pr_debug("payload len = 0\n");
754 if (find_prev_fhdr(skb, &prevhdr, &nhoff, &fhoff) < 0)
757 clone = skb_clone(skb, GFP_ATOMIC);
759 pr_debug("Can't clone skb\n");
763 NFCT_FRAG6_CB(clone)->orig = skb;
765 if (!pskb_may_pull(clone, fhoff + sizeof(*fhdr))) {
766 pr_debug("message is too short.\n");
770 skb_set_transport_header(clone, fhoff);
771 hdr = ipv6_hdr(clone);
772 fhdr = (struct frag_hdr *)skb_transport_header(clone);
774 if (!(fhdr->frag_off & htons(0xFFF9))) {
775 pr_debug("Invalid fragment offset\n");
776 /* It is not a fragmented frame */
780 if (atomic_read(&nf_ct_frag6_mem) > nf_ct_frag6_high_thresh)
781 nf_ct_frag6_evictor();
783 fq = fq_find(fhdr->identification, &hdr->saddr, &hdr->daddr);
785 pr_debug("Can't find and can't create new queue\n");
789 spin_lock(&fq->q.lock);
791 if (nf_ct_frag6_queue(fq, clone, fhdr, nhoff) < 0) {
792 spin_unlock(&fq->q.lock);
793 pr_debug("Can't insert skb to queue\n");
798 if (fq->q.last_in == (FIRST_IN|LAST_IN) && fq->q.meat == fq->q.len) {
799 ret_skb = nf_ct_frag6_reasm(fq, dev);
801 pr_debug("Can't reassemble fragmented packets\n");
803 spin_unlock(&fq->q.lock);
813 void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb,
814 struct net_device *in, struct net_device *out,
815 int (*okfn)(struct sk_buff *))
817 struct sk_buff *s, *s2;
819 for (s = NFCT_FRAG6_CB(skb)->orig; s;) {
820 nf_conntrack_put_reasm(s->nfct_reasm);
821 nf_conntrack_get_reasm(skb);
827 NF_HOOK_THRESH(PF_INET6, hooknum, s, in, out, okfn,
828 NF_IP6_PRI_CONNTRACK_DEFRAG + 1);
831 nf_conntrack_put_reasm(skb);
834 int nf_ct_frag6_kfree_frags(struct sk_buff *skb)
836 struct sk_buff *s, *s2;
838 for (s = NFCT_FRAG6_CB(skb)->orig; s; s = s2) {
849 int nf_ct_frag6_init(void)
851 nf_ct_frag6_hash_rnd = (u32) ((num_physpages ^ (num_physpages>>7)) ^
852 (jiffies ^ (jiffies >> 6)));
854 setup_timer(&nf_ct_frag6_secret_timer, nf_ct_frag6_secret_rebuild, 0);
855 nf_ct_frag6_secret_timer.expires = jiffies
856 + nf_ct_frag6_secret_interval;
857 add_timer(&nf_ct_frag6_secret_timer);
862 void nf_ct_frag6_cleanup(void)
864 del_timer(&nf_ct_frag6_secret_timer);
865 nf_ct_frag6_low_thresh = 0;
866 nf_ct_frag6_evictor();