inet: frag: remove periodic secret rebuild timer
[linux-2.6-block.git] / net / ieee802154 / reassembly.c
index 6f1428c4870b11e9bab087c54d414079514caf8a..20d219682d8456eb04e7dd7016b2ae021bbdb8d9 100644 (file)
@@ -50,29 +50,25 @@ static unsigned int lowpan_hash_frag(__be16 tag, u16 d_size,
                                     const struct ieee802154_addr *saddr,
                                     const struct ieee802154_addr *daddr)
 {
-       u32 c;
-
        net_get_random_once(&lowpan_frags.rnd, sizeof(lowpan_frags.rnd));
-       c = jhash_3words(ieee802154_addr_hash(saddr),
-                        ieee802154_addr_hash(daddr),
-                        (__force u32)(tag + (d_size << 16)),
-                        lowpan_frags.rnd);
-
-       return c & (INETFRAGS_HASHSZ - 1);
+       return jhash_3words(ieee802154_addr_hash(saddr),
+                           ieee802154_addr_hash(daddr),
+                           (__force u32)(tag + (d_size << 16)),
+                           lowpan_frags.rnd);
 }
 
-static unsigned int lowpan_hashfn(struct inet_frag_queue *q)
+static unsigned int lowpan_hashfn(const struct inet_frag_queue *q)
 {
-       struct lowpan_frag_queue *fq;
+       const struct lowpan_frag_queue *fq;
 
        fq = container_of(q, struct lowpan_frag_queue, q);
        return lowpan_hash_frag(fq->tag, fq->d_size, &fq->saddr, &fq->daddr);
 }
 
-static bool lowpan_frag_match(struct inet_frag_queue *q, void *a)
+static bool lowpan_frag_match(const struct inet_frag_queue *q, const void *a)
 {
-       struct lowpan_frag_queue *fq;
-       struct lowpan_create_arg *arg = a;
+       const struct lowpan_frag_queue *fq;
+       const struct lowpan_create_arg *arg = a;
 
        fq = container_of(q, struct lowpan_frag_queue, q);
        return  fq->tag == arg->tag && fq->d_size == arg->d_size &&
@@ -80,10 +76,10 @@ static bool lowpan_frag_match(struct inet_frag_queue *q, void *a)
                ieee802154_addr_equal(&fq->daddr, arg->dst);
 }
 
-static void lowpan_frag_init(struct inet_frag_queue *q, void *a)
+static void lowpan_frag_init(struct inet_frag_queue *q, const void *a)
 {
+       const struct lowpan_create_arg *arg = a;
        struct lowpan_frag_queue *fq;
-       struct lowpan_create_arg *arg = a;
 
        fq = container_of(q, struct lowpan_frag_queue, q);
 
@@ -223,7 +219,6 @@ found:
                return res;
        }
 
-       inet_frag_lru_move(&fq->q);
        return -1;
 err:
        kfree_skb(skb);
@@ -373,11 +368,10 @@ int lowpan_frag_rcv(struct sk_buff *skb, const u8 frag_type)
        if (frag_info->d_size > ieee802154_lowpan->max_dsize)
                goto err;
 
-       inet_frag_evictor(&ieee802154_lowpan->frags, &lowpan_frags, false);
-
        fq = fq_find(net, frag_info, &source, &dest);
        if (fq != NULL) {
                int ret;
+
                spin_lock(&fq->q.lock);
                ret = lowpan_frag_queue(fq, skb, frag_type);
                spin_unlock(&fq->q.lock);
@@ -425,10 +419,12 @@ static struct ctl_table lowpan_frags_ns_ctl_table[] = {
        { }
 };
 
+/* secret interval has been deprecated */
+static int lowpan_frags_secret_interval_unused;
 static struct ctl_table lowpan_frags_ctl_table[] = {
        {
                .procname       = "6lowpanfrag_secret_interval",
-               .data           = &lowpan_frags.secret_interval,
+               .data           = &lowpan_frags_secret_interval_unused,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = proc_dointvec_jiffies,
@@ -568,7 +564,6 @@ int __init lowpan_net_frag_init(void)
        lowpan_frags.qsize = sizeof(struct frag_queue);
        lowpan_frags.match = lowpan_frag_match;
        lowpan_frags.frag_expire = lowpan_frag_expire;
-       lowpan_frags.secret_interval = 10 * 60 * HZ;
        inet_frags_init(&lowpan_frags);
 
        return ret;