From patchwork Mon Feb 14 17:52:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernard Pidoux X-Patchwork-Id: 83145 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C8D6EB70A6 for ; Tue, 15 Feb 2011 05:07:01 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752166Ab1BNSGl (ORCPT ); Mon, 14 Feb 2011 13:06:41 -0500 Received: from shiva145.upmc.fr ([134.157.0.145]:57861 "EHLO shiva.upmc.fr" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752007Ab1BNSGk (ORCPT ); Mon, 14 Feb 2011 13:06:40 -0500 X-Greylist: delayed 860 seconds by postgrey-1.27 at vger.kernel.org; Mon, 14 Feb 2011 13:06:40 EST Received: from courriel.upmc.fr (courriel2.reseau.jussieu.fr [134.157.0.193]) by shiva.upmc.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p1EHqD6S082468 ; Mon, 14 Feb 2011 18:52:13 +0100 (CET) X-Ids: courriel2 Received: from [192.168.0.68] (car75-2-82-66-61-83.fbx.proxad.net [82.66.61.83]) (authentified, mech=PLAIN) by courriel.upmc.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p1EHq9Ob040905 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) ; Mon, 14 Feb 2011 18:52:11 +0100 (CET) (envelope-from bernard.pidoux@upmc.fr) Message-ID: <4D596BC9.4030509@upmc.fr> Date: Mon, 14 Feb 2011 18:52:09 +0100 From: Bernard Pidoux User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101213 Mandriva/3.0.11-0.1mdv2010.1 (2010.1) Thunderbird/3.0.11 MIME-Version: 1.0 To: Linux Netdev List CC: ralf@linux-mips.org, davem@davemloft.net, Bernard Pidoux F6BVP Subject: Re: [PATCH] [ROSE] AX25 packet routing improvement References: <4CF78B70.4060907@free.fr> In-Reply-To: <4CF78B70.4060907@free.fr> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, Here is a second try for this patch that completes the previous one. [PATCH] [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: Bernard Pidoux --- a/net/rose/af_rose.c 2010-12-09 23:17:27.000000000 +0100 +++ b/net/rose/af_rose.c 2010-12-19 15:06:44.399455216 +0100 @@ -803,7 +803,6 @@ 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; @@ -865,12 +864,6 @@ } 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; err = sock_error(sk); /* Always set at this point */ goto out_release;