aboutsummaryrefslogtreecommitdiffstats
path: root/net/rose
diff options
context:
space:
mode:
authorBernard Pidoux <f6bvp@free.fr>2011-02-14 16:31:09 -0500
committerDavid S. Miller <davem@davemloft.net>2011-02-14 16:31:09 -0500
commitc5d8b24ad0a9a45e163a6769b4eb7e7f1fb9aa7f (patch)
tree2ad755121a6f6a900d374ad27257d3196bb2276e /net/rose
parent31d409373cca3517a30540b51f55dcb1f5af0d49 (diff)
ROSE: rose AX25 packet routing improvement
FPAC AX25 packet application is using Linux kernel ROSE routing skills in order to connect or send packets to remote stations knowing their ROSE address via a network of interconnected nodes. Each FPAC node has a ROSE routing table that Linux ROSE module is looking at each time a ROSE frame is relayed by the node or when a connect request to a neighbor node is received. A previous patch improved the system time response by looking at already established routes each time the system was looking for a route to relay a frame. If a neighbor node routing the destination address was already connected, then the frame would be sent through him. If not, a connection request would be issued. The present patch extends the same routing capability to a connect request asked by a user locally connected into an FPAC node. Without this patch, a connect request was not well handled unless it was directed to an immediate connected neighbor of the local node. Implemented at a number of ROSE FPAC node stations, the present patch improved dramatically FPAC ROSE routing time response and efficiency. Signed-off-by: Bernard Pidoux <f6bvp@free.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rose')
-rw-r--r--net/rose/rose_route.c28
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 */
676struct rose_neigh *rose_get_neigh(rose_address *addr, unsigned char *cause, 676struct 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
713out: 718out:
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