Skip to contentSkip to conversation

AX.25: Use constant instead of magic number.

PATCH Applied Ralf Baechle 3 participants 3 messages Oct 18, 2005 – Oct 28, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 AX.25: Use constant instead of magic number.

 net/rose/rose_route.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
net/rose/rose_route.c +1 -1
Index: net-git/net/rose/rose_route.c
===================================================================
@@ -727,7 +727,7 @@ int rose_rt_ioctl(unsigned int cmd, void
 		}
 		if (rose_route.mask > 10) /* Mask can't be more than 10 digits */
 			return -EINVAL;
-		if (rose_route.ndigis > 8) /* No more than 8 digipeats */
+		if (rose_route.ndigis > AX25_MAX_DIGIS)
 			return -EINVAL;
 		err = rose_add_node(&rose_route, dev);
 		dev_put(dev);
#1 lore raw

af_rose.c

Hi,

Concerning rose module, here is a patch proposed by Jean-Paul F6FBB for af_rose.c

It is against linux-2.6.14-rc5

This patch only adds a loop near the end of rose_connect() in order to make it try to connect rose next_neighbour node in case of connect failure, until we reach the true end of the neighbour list.

With the guys of FADCA and other french hams using ROSE/FPAC we found that ROSE did not scan the alternate routes even when there was one available.

This could be an important point in case of catastrophic events with telecommunication failure. The possibility to handle emergency traffic via alternate routes could be a vital necessity.

The principle of this patch has been tested with kernel 2.2 and 2.6 and it works well using F6FBB ROSE/FPAC packet switch application.

I suggest that it should be included into the next kernel rose module.

73 de Bernard, f6bvp

rose/af_rose.c +6 -1
@@ -751,7 +751,7 @@
 
 		rose_insert_socket(sk);		/* Finish the bind */
 	}
-
+rose_try_next_neigh:
 	rose->dest_addr   = addr->srose_addr;
 	rose->dest_call   = addr->srose_call;
 	rose->rand        = ((long)rose & 0xFFFF) + rose->lci;
@@ -809,6 +809,11 @@
 	}
 
 	if (sk->sk_state != TCP_ESTABLISHED) {
+	/* Try next neighbour */
+		rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, &diagnostic);
+		if (rose->neighbour)
+			goto rose_try_next_neigh;
+	/* No more neighbour */
 		sock->state = SS_UNCONNECTED;
 		return sock_error(sk);	/* Always set at this point */
 	}