From: Ralf Baechle Date: Tue, 4 Jul 2006 02:32:23 +0000 (-0700) Subject: [ROSE]: Try all routes when establishing a ROSE connections. X-Git-Tag: tegra-9.12.3~19594^2~19 X-Git-Url: https://nv-tegra.nvidia.com/r/gitweb?p=linux-2.6.git;a=commitdiff_plain;h=d85838c55d836c33077344fab424f200f2827d84 [ROSE]: Try all routes when establishing a ROSE connections. From Jean-Paul F6FBB ROSE will only try to establish a route using the first route in its routing table. Fix to iterate through all additional routes if a connection attempt has failed. Signed-off-by: Ralf Baechle Signed-off-by: David S. Miller --- diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 7799fe82aeb..d0a67bb3136 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c @@ -752,7 +752,7 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le 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; @@ -810,6 +810,11 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le } 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 */ }