public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Marek Lindner <lindner_marek@yahoo.de>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: introduce a boolean switch to enable/disable DAT
Date: Tue, 17 Apr 2012 12:33:31 +0200	[thread overview]
Message-ID: <201204171233.31979.lindner_marek@yahoo.de> (raw)
In-Reply-To: <1334658294-2413-2-git-send-email-ordex@autistici.org>

On Tuesday, April 17, 2012 12:24:53 Antonio Quartulli wrote:
> +static void arp_change_timeout(struct net_device *soft_iface, bool
> enable_dat) +{
> +       struct in_device *in_dev = in_dev_get(soft_iface);
> +       if (!in_dev) {
> +               pr_err("Unable to set ARP parameters for the batman
> interface '%s'\n", +                      soft_iface->name);
> +               return;
> +       }
> +
> +       if (enable_dat) {
> +               /* 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; +       } else {
> +               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);
> +}
> +
> +void dat_sysfs_change(struct net_device *soft_iface)
> +{
> +       struct bat_priv *bat_priv = netdev_priv(soft_iface);
> +
> +       if (!bat_priv)
> +               return;
> +
> +       /* increase or decrease the ARP timeout */
> +       arp_change_timeout(soft_iface,
> +                          atomic_read(&bat_priv->distributed_arp_table));
> +}

AFAIK there is no check whether the received value actually changes something 
but arp_change_timeout() implicitely assumes so. I guess the following will 
break the timeouts:

echo 0 > /sys/class/net/bat0/mesh/distributed_arp_table
echo 0 > /sys/class/net/bat0/mesh/distributed_arp_table

Regards,
Marek

  reply	other threads:[~2012-04-17 10:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-17 10:24 [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: drop useless argument for arp_change_timeout() Antonio Quartulli
2012-04-17 10:24 ` [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: introduce a boolean switch to enable/disable DAT Antonio Quartulli
2012-04-17 10:33   ` Marek Lindner [this message]
2012-04-17 10:35   ` Marek Lindner
2012-04-17 10:24 ` [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: use static inline functions instead of bla(...) Antonio Quartulli

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=201204171233.31979.lindner_marek@yahoo.de \
    --to=lindner_marek@yahoo.de \
    --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