 for (i = 0; i <= tbl->hash_mask; i++) { struct neighbour *n, **np = &tbl->hash_buckets[i];  while ((n = *np) != NULL) { if (dev && n->dev != dev) { np = &n->next; continue; } *np = n->next; write_lock(&n->lock); neigh_del_timer(n); n->dead = 1;  if (atomic_read(&n->refcnt) != 1) { /* The most unpleasant situation. We must destroy neighbour entry, but someone still uses it.  The destroy will be delayed until the last user releases us, but we must kill timers etc. and move it to safe state. */ skb_queue_purge(&n->arp_queue); n->output = neigh_blackhole; if (n->nud_state & NUD_VALID) n->nud_state = NUD_NOARP; else n->nud_state = NUD_NONE; NEIGH_PRINTK2("neigh %p is stray.\n", n); } write_unlock(&n->lock); neigh_release(n); } }  
neigh_flush_dev(tbl, dev); 
int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev){	int i;	write_lock_bh(&tbl->lock);	for (i = 0; i <= tbl->hash_mask; i++) {		struct neighbour *n, **np = &tbl->hash_buckets[i];		while ((n = *np) != NULL) {			if (dev && n->dev != dev) {				np = &n->next;				continue;			}			*np = n->next;			write_lock(&n->lock);			neigh_del_timer(n);			n->dead = 1;			if (atomic_read(&n->refcnt) != 1) {				/* The most unpleasant situation.				   We must destroy neighbour entry,				   but someone still uses it.				   The destroy will be delayed until				   the last user releases us, but				   we must kill timers etc. and move				   it to safe state.				 */				skb_queue_purge(&n->arp_queue);				n->output = neigh_blackhole;				if (n->nud_state & NUD_VALID)					n->nud_state = NUD_NOARP;				else					n->nud_state = NUD_NONE;				NEIGH_PRINTK2("neigh %p is stray.\n", n);			}			write_unlock(&n->lock);			neigh_release(n);		}	}	pneigh_ifdown(tbl, dev);	write_unlock_bh(&tbl->lock);	del_timer_sync(&tbl->proxy_timer);	pneigh_queue_purge(&tbl->proxy_queue);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/49636bb12892786e4a7b207b37ca7b0c5ca1cae0/neighbour.c/buggy/net/core/neighbour.c