From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Marek Lindner Date: Tue, 17 Apr 2012 12:35:05 +0200 References: <1334658294-2413-1-git-send-email-ordex@autistici.org> <1334658294-2413-2-git-send-email-ordex@autistici.org> In-Reply-To: <1334658294-2413-2-git-send-email-ordex@autistici.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201204171235.05470.lindner_marek@yahoo.de> Subject: Re: [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: introduce a boolean switch to enable/disable DAT 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: , To: The list for a Better Approach To Mobile Ad-hoc Networking 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); > +} One more thing: Are we never going to release the in_dev ? Regards, Marek