--- a/net/rose/rose_route.c 2010-08-27 01:47:12.000000000 +0200 +++ b/net/rose/rose_route.c 2010-11-25 15:50:30.885623929 +0100 @@ -672,34 +672,41 @@ * Find a neighbour or a route given a ROSE address. */ struct rose_neigh *rose_get_neigh(rose_address *addr, unsigned char *cause, - unsigned char *diagnostic, int new) + unsigned char *diagnostic, int route_frame) { struct rose_neigh *res = NULL; struct rose_node *node; int failed = 0; int i; - if (!new) spin_lock_bh(&rose_node_list_lock); for (node = rose_node_list; node != NULL; node = node->next) { if (rosecmpm(addr, &node->address, node->mask) == 0) { for (i = 0; i < node->count; i++) { - if (new) { - if (node->neighbour[i]->restarted) { - res = node->neighbour[i]; - goto out; - } + if (node->neighbour[i]->restarted) { + res = node->neighbour[i]; + goto out; } - else { + } + } + } + if (!route_frame) { /* connect request */ + spin_lock_bh(&rose_node_list_lock); + for (node = rose_node_list; node != NULL; node = node->next) { + if (rosecmpm(addr, &node->address, node->mask) == 0) { + for (i = 0; i < node->count; i++) { if (!rose_ftimer_running(node->neighbour[i])) { res = node->neighbour[i]; + failed = 0; + spin_unlock_bh(&rose_node_list_lock); goto out; - } else - failed = 1; + } + failed = 1; } } } + spin_unlock_bh(&rose_node_list_lock); } - + if (failed) { *cause = ROSE_OUT_OF_ORDER; *diagnostic = 0; @@ -709,8 +716,6 @@ } out: - if (!new) spin_unlock_bh(&rose_node_list_lock); - return res; }