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