From patchwork Tue Nov 8 11:34:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1335 Return-Path: Received: from latitanza.investici.org (latitanza.investici.org [82.94.249.234]) by open-mesh.org (Postfix) with ESMTPS id D0A7F60084A for ; Tue, 8 Nov 2011 12:34:33 +0100 (CET) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [82.94.249.234] (latitanza [82.94.249.234]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 292369836D; Tue, 8 Nov 2011 11:34:33 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 latitanza.investici.org 292369836D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1320752073; bh=/8mlh0mCr9r7M1ua70lKjSDKVdSrh4ViCfs4hFHUT74=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=FB+AKSWy98zX88rzvtqgoBfQH9KcHAsoff4z1xuWwuwq28nfDiaFv9RAGMxDy2lny uhRz39PmehhMYYnRlAJRtQGXpzzQHuivG+XJ/dt8bey2P0DPe65vct/IUHkt8uRUaL rFrxNG+sfdd1/YYyHhwSfmmRntrAm4yLJL7lkFi0= From: Antonio Quartulli To: b.a.t.m.a.n@lists.open-mesh.org Date: Tue, 8 Nov 2011 12:34:21 +0100 Message-Id: <1320752062-21776-7-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1320752062-21776-1-git-send-email-ordex@autistici.org> References: <1320752062-21776-1-git-send-email-ordex@autistici.org> Subject: [B.A.T.M.A.N.] [PATCHv2 6/7] batman-adv: Distributed ARP Table - increase default soft_iface ARP table timeout 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: Tue, 08 Nov 2011 11:34:34 -0000 The default timeout value for ARP entries belonging to any soft_iface ARP table has been incremented by a factor 4. This is necessary because the DHT will store several network entries in the soft_iface ARP table. Signed-off-by: Antonio Quartulli --- - nothing changed main.h | 4 ++++ soft-interface.c | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/main.h b/main.h index 13f63d8..8c534b4 100644 --- a/main.h +++ b/main.h @@ -69,6 +69,10 @@ /* numbers of originator to contact for any STORE/GET DHT operation */ #define DHT_CANDIDATES_NUM 3 +/* Factor which default ARP timeout values of the soft_iface table are + * multiplied by */ +#define ARP_TIMEOUT_FACTOR 4 + #define NUM_WORDS (TQ_LOCAL_WINDOW_SIZE / WORD_BIT_SIZE) #define LOG_BUF_LEN 8192 /* has to be a power of 2 */ diff --git a/soft-interface.c b/soft-interface.c index 91b0d40..a8f8a60 100644 --- a/soft-interface.c +++ b/soft-interface.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "unicast.h" @@ -832,6 +833,7 @@ static void interface_setup(struct net_device *dev) struct net_device *softif_create(const char *name) { struct net_device *soft_iface; + struct in_device *in_dev; struct bat_priv *bat_priv; int ret; @@ -847,6 +849,21 @@ struct net_device *softif_create(const char *name) goto free_soft_iface; } + in_dev = in_dev_get(soft_iface); + if (!in_dev) { + pr_err("Unable to set ARP parameters for the batman interface " + "'%s'\n", name); + goto free_soft_iface; + } + + /* Introduce a delay in the ARP state-machine transactions. Entries + * will be kept in the ARP table for the default time multiplied by 4 */ + in_dev->arp_parms->base_reachable_time *= ARP_TIMEOUT_FACTOR; + in_dev->arp_parms->gc_staletime *= ARP_TIMEOUT_FACTOR; + in_dev->arp_parms->reachable_time *= ARP_TIMEOUT_FACTOR; + + in_dev_put(in_dev); + bat_priv = netdev_priv(soft_iface); atomic_set(&bat_priv->aggregated_ogms, 1);