From patchwork Mon Apr 25 09:23:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 921 Return-Path: Received: from rivolta.investici.org (rivolta.investici.org [78.46.89.173]) by open-mesh.org (Postfix) with ESMTPS id C6AAA15439B for ; Mon, 25 Apr 2011 11:23:58 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [78.46.89.173] (rivolta [78.46.89.173]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 14E1710A187; Mon, 25 Apr 2011 09:23:58 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.6.0 rivolta.investici.org 14E1710A187 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1303723438; bh=Xv71mBkLDYx+iWonAA7p4rDF1JhlIkZwmXgUF2 SHt04=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=je6qAPxcTnGnG+N3gnj8j4jQeum3ksDki+sq8st/VBMrolv/UdU7xpueknYo+GT3G iZgvY3HzPaaZKZmy+Tj+3bxn6KqNGfztYPY/KLuWUakgbu2qX3tBwGjsdiKlLqR++/5 V1EFduoO20zWyNd2M6xVBCwKrhjfzltsW9tGxcE= From: Antonio Quartulli To: "B.A.T.M.A.N" Date: Mon, 25 Apr 2011 11:23:53 +0200 Message-Id: <1303723433-1045-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1303723103-29582-1-git-send-email-ordex@autistici.org> References: <1303723103-29582-1-git-send-email-ordex@autistici.org> Subject: [B.A.T.M.A.N.] [PATCHv2] batman-adv: gw_node_update() now adds a new gw_node if no curr_gw is selected X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 09:23:58 -0000 This is a regression from 8ffdea813e32cee3c60be36fb9e6a5e077e51ea0 gw_node_update() doesn't add a new gw_node in case of empty curr_gw. This means that at the beginning no gw_node is added, leading to an empty gateway list. Signed-off-by: Antonio Quartulli --- gateway_client.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/gateway_client.c b/gateway_client.c index 2acd7a6..d8adacd 100644 --- a/gateway_client.c +++ b/gateway_client.c @@ -311,8 +311,6 @@ void gw_node_update(struct bat_priv *bat_priv, struct gw_node *gw_node, *curr_gw; curr_gw = gw_get_selected_gw_node(bat_priv); - if (!curr_gw) - goto out; rcu_read_lock(); hlist_for_each_entry_rcu(gw_node, node, &bat_priv->gw_list, list) { @@ -350,7 +348,7 @@ deselect: gw_deselect(bat_priv); unlock: rcu_read_unlock(); -out: + if (curr_gw) gw_node_free_ref(curr_gw); }