diff options
Diffstat (limited to 'net/rose')
-rw-r--r-- | net/rose/rose_route.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c index b4fdaac233f7..88a77e90e7e8 100644 --- a/net/rose/rose_route.c +++ b/net/rose/rose_route.c | |||
@@ -674,29 +674,34 @@ struct rose_route *rose_route_free_lci(unsigned int lci, struct rose_neigh *neig | |||
674 | * Find a neighbour or a route given a ROSE address. | 674 | * Find a neighbour or a route given a ROSE address. |
675 | */ | 675 | */ |
676 | struct rose_neigh *rose_get_neigh(rose_address *addr, unsigned char *cause, | 676 | struct rose_neigh *rose_get_neigh(rose_address *addr, unsigned char *cause, |
677 | unsigned char *diagnostic, int new) | 677 | unsigned char *diagnostic, int route_frame) |
678 | { | 678 | { |
679 | struct rose_neigh *res = NULL; | 679 | struct rose_neigh *res = NULL; |
680 | struct rose_node *node; | 680 | struct rose_node *node; |
681 | int failed = 0; | 681 | int failed = 0; |
682 | int i; | 682 | int i; |
683 | 683 | ||
684 | if (!new) spin_lock_bh(&rose_node_list_lock); | 684 | if (!route_frame) spin_lock_bh(&rose_node_list_lock); |
685 | for (node = rose_node_list; node != NULL; node = node->next) { | 685 | for (node = rose_node_list; node != NULL; node = node->next) { |
686 | if (rosecmpm(addr, &node->address, node->mask) == 0) { | 686 | if (rosecmpm(addr, &node->address, node->mask) == 0) { |
687 | for (i = 0; i < node->count; i++) { | 687 | for (i = 0; i < node->count; i++) { |
688 | if (new) { | 688 | if (node->neighbour[i]->restarted) { |
689 | if (node->neighbour[i]->restarted) { | 689 | res = node->neighbour[i]; |
690 | res = node->neighbour[i]; | 690 | goto out; |
691 | goto out; | ||
692 | } | ||
693 | } | 691 | } |
694 | else { | 692 | } |
693 | } | ||
694 | } | ||
695 | if (!route_frame) { /* connect request */ | ||
696 | for (node = rose_node_list; node != NULL; node = node->next) { | ||
697 | if (rosecmpm(addr, &node->address, node->mask) == 0) { | ||
698 | for (i = 0; i < node->count; i++) { | ||
695 | if (!rose_ftimer_running(node->neighbour[i])) { | 699 | if (!rose_ftimer_running(node->neighbour[i])) { |
696 | res = node->neighbour[i]; | 700 | res = node->neighbour[i]; |
701 | failed = 0; | ||
697 | goto out; | 702 | goto out; |
698 | } else | 703 | } |
699 | failed = 1; | 704 | failed = 1; |
700 | } | 705 | } |
701 | } | 706 | } |
702 | } | 707 | } |
@@ -711,8 +716,7 @@ struct rose_neigh *rose_get_neigh(rose_address *addr, unsigned char *cause, | |||
711 | } | 716 | } |
712 | 717 | ||
713 | out: | 718 | out: |
714 | if (!new) spin_unlock_bh(&rose_node_list_lock); | 719 | if (!route_frame) spin_unlock_bh(&rose_node_list_lock); |
715 | |||
716 | return res; | 720 | return res; |
717 | } | 721 | } |
718 | 722 | ||