- /*DPRINTK("idle_timer_check\n");*/
- write_lock(&clip_tbl.lock);
- for (i = 0; i <= NEIGH_HASHMASK; i++) {
- struct neighbour **np;
-
- for (np = &clip_tbl.hash_buckets[i]; *np;) {
- struct neighbour *n = *np;
- struct atmarp_entry *entry = NEIGH2ENTRY(n);
- struct clip_vcc *clip_vcc;
-
- write_lock(&n->lock);
-
- for (clip_vcc = entry->vccs; clip_vcc;
- clip_vcc = clip_vcc->next)
- if (clip_vcc->idle_timeout &&
- time_after(jiffies, clip_vcc->last_use+
- clip_vcc->idle_timeout)) {
- DPRINTK("releasing vcc %p->%p of "
- "entry %p\n",clip_vcc,clip_vcc->vcc,
- entry);
- vcc_release_async(clip_vcc->vcc,
- -ETIMEDOUT);
- }
- if (entry->vccs ||
- time_before(jiffies, entry->expires)) {
- np = &n->next;
- write_unlock(&n->lock);
- continue;
- }
- if (atomic_read(&n->refcnt) > 1) {
- struct sk_buff *skb;
-
- DPRINTK("destruction postponed with ref %d\n",
- atomic_read(&n->refcnt));
- while ((skb = skb_dequeue(&n->arp_queue)) !=
- NULL)
- dev_kfree_skb(skb);
- np = &n->next;
- write_unlock(&n->lock);
- continue;
- }
- *np = n->next;
- DPRINTK("expired neigh %p\n",n);
- n->dead = 1;
- write_unlock(&n->lock);
- neigh_release(n);
+ for (cv = entry->vccs; cv; cv = cv->next) {
+ unsigned long exp = cv->last_use + cv->idle_timeout;
+
+ if (cv->idle_timeout && time_after(jiffies, exp)) {
+ DPRINTK("releasing vcc %p->%p of entry %p\n",
+ cv, cv->vcc, entry);
+ vcc_release_async(cv->vcc, -ETIMEDOUT);