Skip to content

Commit c5d8b24

Browse files
f6bvpdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 31d4093 commit c5d8b24

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

net/rose/rose_route.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -674,29 +674,34 @@ struct rose_route *rose_route_free_lci(unsigned int lci, struct rose_neigh *neig
674674
* Find a neighbour or a route given a ROSE address.
675675
*/
676676
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)
678678
{
679679
struct rose_neigh *res = NULL;
680680
struct rose_node *node;
681681
int failed = 0;
682682
int i;
683683

684-
if (!new) spin_lock_bh(&rose_node_list_lock);
684+
if (!route_frame) spin_lock_bh(&rose_node_list_lock);
685685
for (node = rose_node_list; node != NULL; node = node->next) {
686686
if (rosecmpm(addr, &node->address, node->mask) == 0) {
687687
for (i = 0; i < node->count; i++) {
688-
if (new) {
689-
if (node->neighbour[i]->restarted) {
690-
res = node->neighbour[i];
691-
goto out;
692-
}
688+
if (node->neighbour[i]->restarted) {
689+
res = node->neighbour[i];
690+
goto out;
693691
}
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++) {
695699
if (!rose_ftimer_running(node->neighbour[i])) {
696700
res = node->neighbour[i];
701+
failed = 0;
697702
goto out;
698-
} else
699-
failed = 1;
703+
}
704+
failed = 1;
700705
}
701706
}
702707
}
@@ -711,8 +716,7 @@ struct rose_neigh *rose_get_neigh(rose_address *addr, unsigned char *cause,
711716
}
712717

713718
out:
714-
if (!new) spin_unlock_bh(&rose_node_list_lock);
715-
719+
if (!route_frame) spin_unlock_bh(&rose_node_list_lock);
716720
return res;
717721
}
718722

0 commit comments

Comments
 (0)