Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68aa3fd5 authored by Bernard Pidoux's avatar Bernard Pidoux Committed by David S. Miller
Browse files

ROSE: AX25: finding routes simplification



With previous patch, rose_get_neigh() routine
investigates the full list of neighbor nodes
until it finds or not an already connected node whether
it is called locally or through a level 3 transit frame.
If no routes are opened through an adjacent connected node
then a classical connect request is attempted.

Then there is no more reason for an extra loop such
as the one removed by this patch.

Signed-off-by: default avatarBernard Pidoux <f6bvp@free.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c5d8b24a
Loading
Loading
Loading
Loading
+0 −7
Original line number Original line Diff line number Diff line
@@ -803,7 +803,6 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le


		rose_insert_socket(sk);		/* Finish the bind */
		rose_insert_socket(sk);		/* Finish the bind */
	}
	}
rose_try_next_neigh:
	rose->dest_addr   = addr->srose_addr;
	rose->dest_addr   = addr->srose_addr;
	rose->dest_call   = addr->srose_call;
	rose->dest_call   = addr->srose_call;
	rose->rand        = ((long)rose & 0xFFFF) + rose->lci;
	rose->rand        = ((long)rose & 0xFFFF) + rose->lci;
@@ -865,12 +864,6 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
	}
	}


	if (sk->sk_state != TCP_ESTABLISHED) {
	if (sk->sk_state != TCP_ESTABLISHED) {
	/* Try next neighbour */
		rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, &diagnostic, 0);
		if (rose->neighbour)
			goto rose_try_next_neigh;

		/* No more neighbours */
		sock->state = SS_UNCONNECTED;
		sock->state = SS_UNCONNECTED;
		err = sock_error(sk);	/* Always set at this point */
		err = sock_error(sk);	/* Always set at this point */
		goto out_release;
		goto out_release;