From patchwork Sun May 17 09:37:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruben Wisniewski X-Patchwork-Id: 4477 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=46.38.231.10; helo=we70a.netcup.net; envelope-from=ruben@freifunk-nrw.de; receiver=b.a.t.m.a.n@lists.open-mesh.org Received: from we70a.netcup.net (we70a.netcup.net [46.38.231.10]) by open-mesh.org (Postfix) with ESMTPS id D762A6016A8 for ; Sun, 17 May 2015 11:37:27 +0200 (CEST) Received: from i3.local (port-92-195-0-240.dynamic.qsc.de [92.195.0.240]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by we70a.netcup.net (Postfix) with ESMTPSA id AA37B4659D for ; Sun, 17 May 2015 11:37:27 +0200 (CEST) Date: Sun, 17 May 2015 11:37:26 +0200 From: Ruben Wisniewski To: b.a.t.m.a.n@lists.open-mesh.org Message-ID: <20150517113726.47de614d@i3.local> Organization: Verbund freier Netzwerke NRW e.V. X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH] fix algorithm, which was unintentional changed on update from 2013 to 2014 X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.15 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: Sun, 17 May 2015 09:37:28 -0000 This patch restores the unintentional change on commit http://www.open-mesh.org/projects/batman-adv/repository/revisions/0853ec7fafe0a195754454832993c6b35e22b842/diff/gateway_client.c Original the algorithm uses kbit for calculation, now the values are stored as "mbit*10" so we have to multiply it with 100 to restore the old behavior. Signed-off-by: Ruben Wisniewsi --- net/batman-adv/gateway_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c index 1f50661..6f00584 100644 --- a/net/batman-adv/gateway_client.c +++ b/net/batman-adv/gateway_client.c @@ -185,7 +185,7 @@ batadv_gw_get_best_gw_node(struct batadv_priv *bat_priv) switch (atomic_read(&bat_priv->gw_sel_class)) { case 1: /* fast connection */ tmp_gw_factor = tq_avg * tq_avg; - tmp_gw_factor *= gw_node->bandwidth_down; + tmp_gw_factor *= gw_node->bandwidth_down * 100; tmp_gw_factor *= 100 * 100; tmp_gw_factor /= gw_divisor;