From: Antonio Quartulli <ordex@autistici.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCHv4 6/7] batman-adv: Distributed ARP Table - increase default soft_iface ARP table timeout
Date: Thu, 24 Nov 2011 23:21:18 +0100 [thread overview]
Message-ID: <1322173279-18338-7-git-send-email-ordex@autistici.org> (raw)
In-Reply-To: <1322173279-18338-1-git-send-email-ordex@autistici.org>
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 <ordex@autistici.org>
---
main.h | 4 ++++
soft-interface.c | 17 +++++++++++++++++
2 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/main.h b/main.h
index a915db6..8672b04 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 21991e1..1194cf7 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -36,6 +36,7 @@
#include <linux/ethtool.h>
#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
+#include <linux/inetdevice.h>
#include "unicast.h"
@@ -825,6 +826,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;
@@ -840,6 +842,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);
--
1.7.3.4
next prev parent reply other threads:[~2011-11-24 22:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-24 22:21 [B.A.T.M.A.N.] [PATCHv4 0/7] DAT: Distributed ARP Table Antonio Quartulli
2011-11-24 22:21 ` [B.A.T.M.A.N.] [PATCHv4 1/7] batman-adv: implement an helper function to forge unicast packets Antonio Quartulli
2011-11-25 8:18 ` Andrew Lunn
2011-11-25 8:54 ` Sven Eckelmann
2011-11-24 22:21 ` [B.A.T.M.A.N.] [PATCHv4 2/7] batman-adv: add a new log level for DAT-ARP debugging Antonio Quartulli
2011-11-24 22:21 ` [B.A.T.M.A.N.] [PATCHv4 3/7] batman-adv: Distributed ARP Table - create the DHT helper functions Antonio Quartulli
2011-11-24 22:21 ` [B.A.T.M.A.N.] [PATCHv4 4/7] batman-adv: Distributed ARP Table - add ARP parsing functions Antonio Quartulli
2011-11-25 8:31 ` Andrew Lunn
2011-11-25 11:04 ` Antonio Quartulli
2011-11-24 22:21 ` [B.A.T.M.A.N.] [PATCHv4 5/7] batman-adv: Distributed ARP Table - add snooping functions for ARP messages Antonio Quartulli
2011-11-25 1:18 ` Marek Lindner
2011-11-25 8:45 ` Andrew Lunn
2011-11-25 11:17 ` Antonio Quartulli
2011-11-25 21:09 ` Andrew Lunn
2011-11-26 9:09 ` Antonio Quartulli
2011-11-24 22:21 ` Antonio Quartulli [this message]
2011-11-24 22:21 ` [B.A.T.M.A.N.] [PATCHv4 7/7] batman-adv: add Distributed ARP Table compile option Antonio Quartulli
2011-11-25 1:19 ` Marek Lindner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1322173279-18338-7-git-send-email-ordex@autistici.org \
--to=ordex@autistici.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).