From patchwork Sun Jul 22 11:20:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 2209 Return-Path: Received: from nm13.bullet.mail.ukl.yahoo.com (nm13.bullet.mail.ukl.yahoo.com [217.146.183.187]) by open-mesh.org (Postfix) with SMTP id B0B946007C2 for ; Sun, 22 Jul 2012 13:20:20 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass reason="1024-bit key; insecure key" header.i=@yahoo.de header.b=pDUzYUFn; dkim-adsp=pass; dkim-atps=neutral Received: from [217.146.183.181] by nm13.bullet.mail.ukl.yahoo.com with NNFMP; 22 Jul 2012 11:20:19 -0000 Received: from [77.238.184.64] by tm12.bullet.mail.ukl.yahoo.com with NNFMP; 22 Jul 2012 11:20:19 -0000 Received: from [127.0.0.1] by smtp133.mail.ukl.yahoo.com with NNFMP; 22 Jul 2012 11:20:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1342956019; bh=Rsm9kX9MqXcv14izy4ne4XmYnhD3d9JgqmoiZqpfmGI=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Subject:Date:User-Agent:References:In-Reply-To:MIME-Version:Content-Type:Message-Id; b=pDUzYUFn/EnQoibK5a2mn2IqMHEX/6wuybFttW2OHw0cd+YXL5gAALdhJ31mjyBMfe00zWcnhcYxAmYrHo0jM8jKD/M65J9P5PPUbxJEhknWuYnS3ImBZzuyCQINvLaddsy+/6+NmYx4jwdw2klr3qpi1AzWb+GaClgqbdPoJB0= X-Yahoo-Newman-Id: 629051.29504.bm@smtp133.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: v2IW_zsVM1k2npticoh_7xH0NyxAWekWlrbDB3iT3wM283V GLM2yqUV.MDFPAoH1hrlOVJWv97Lb.uCWupHES9kH86Q4hXwWyNAypU6IMS5 PJkMmil547W2wP4KZxl..YdWlhV7Uv5sRueL5CDt5WJ0ZznEg8TZKwuCn3zz j91.0d6xhnicJeVCxY4jIxV5X5cpZITmuFrmF872igON7LDQJLjRECql12on 1dko6bffDiq1lrmFEDxKbQDzEL0gvk4jKucv1adcQ3OHm1huTXG8B74e7swd DAOqhIU_1M.XiFLz.XcYMK7wbHgA1zCjtLuS8wrLEAZscmPlHvDlsHgJOSje jPiRyWFU9mZi7H2cVHDpTI9F5dN5bV8MCX0aMX4rh5gRN_rA7uXKKMI2V2Gk D5SA- X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from turgot.localnet (lindner_marek@217.85.76.216 with plain) by smtp133.mail.ukl.yahoo.com with SMTP; 22 Jul 2012 11:20:19 +0000 GMT From: Marek Lindner To: "The list for a Better Approach To Mobile Ad-hoc Networking" Date: Sun, 22 Jul 2012 13:20:13 +0200 User-Agent: KMail/1.13.7 (Linux/3.0.0-1-amd64; KDE/4.6.5; x86_64; ; ) References: <5008C14B.6040707@codigosur.org> In-Reply-To: <5008C14B.6040707@codigosur.org> MIME-Version: 1.0 Message-Id: <201207221320.14242.lindner_marek@yahoo.de> Subject: Re: [B.A.T.M.A.N.] batman-adv not selecting a gateway when using "client 1" through uci config 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, 22 Jul 2012 11:20:21 -0000 On Friday, July 20, 2012 04:24:11 Nicolás Echániz wrote: > there's no gateway being selected until I manually run: > # batctl gw_mode client 1 > (which was te current mode anyway) > on each client. > > In fact, connected computers are not being served DHCP offers because of > this. > > Is this some known behavior or just something I overlooked? In fact you managed to uncover a regression that was overlooked for quite some time. Guess gw selection class 1 is rarely used. :-) Can you apply the attached patch and verify that it fixes the problem ? Here in my test setup it does. Regards, Marek From 0a29f3a348c68f375585e25153da0f0a061fd71d Mon Sep 17 00:00:00 2001 From: Marek Lindner Date: Sun, 22 Jul 2012 13:04:48 +0200 Subject: [PATCH] batman-adv: select an internet gateway if none was chosen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a regression introduced by: 6a17ecc4603be7f065c38b288d038a0082bbf21d Reported-by: Nicolás Echániz Signed-off-by: Marek Lindner --- gateway_client.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gateway_client.c b/gateway_client.c index 47f7186..dace001 100644 --- a/gateway_client.c +++ b/gateway_client.c @@ -197,11 +197,11 @@ void gw_election(struct bat_priv *bat_priv) if (atomic_read(&bat_priv->gw_mode) != GW_MODE_CLIENT) goto out; - if (!atomic_dec_not_zero(&bat_priv->gw_reselect)) - goto out; - curr_gw = gw_get_selected_gw_node(bat_priv); + if (!atomic_dec_not_zero(&bat_priv->gw_reselect) && curr_gw) + goto out; + next_gw = gw_get_best_gw_node(bat_priv); if (curr_gw == next_gw) -- 1.7.9.1