From patchwork Mon Aug 16 16:51:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 319 Return-Path: Received: from smtp132.mail.ukl.yahoo.com (smtp132.mail.ukl.yahoo.com [77.238.184.63]) by open-mesh.net (Postfix) with SMTP id 2CFC1154510 for ; Mon, 16 Aug 2010 18:52:12 +0200 (CEST) Received: (qmail 93338 invoked from network); 16 Aug 2010 16:52:11 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; h=DKIM-Signature:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Subject:Date:User-Agent:References:In-Reply-To:MIME-Version:Content-Type:Message-Id; b=BhGf/z5IlLWjpEeW3j8Tv23+FYD/v73o8sDatpqr34wXA10dOxaEt3GuE0O/WOWOjgqtMS0Ef90ZZD7CXjQDmYVg009ErEtqc/UnDUwnEYUn271fJt0WREDDOqkbI7PQHowQDs7fTctMmCfO7F4UkWDIRY+L3F6xw0NdVlSFph4= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1281977531; bh=LIj+Poe+wfn0p2ZwMuo0o2/fCQPCSzzVhHSs2mWNrrQ=; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Subject:Date:User-Agent:References:In-Reply-To:MIME-Version:Content-Type:Message-Id; b=uMTUJHZ5NRh/QznCYLu8U0f//AFOhYz72G33RLAf+3xL0KqxKQ2Odj7cWSQFSrowyuDoU6XDajg2JOmluYmX8HcPAWTQlKzZ+xapyMaqHb2peCyeFt2lFiCrhRnrT5exnfD5W//wHXbAVUdqcLVIuTunTMmN1y4NUQVC5Ral9CY= Received: from turgot.localnet (lindner_marek@79.205.242.4 with plain) by smtp132.mail.ukl.yahoo.com with SMTP; 16 Aug 2010 16:52:10 +0000 GMT X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- X-YMail-OSG: Ushb_VoVM1kkRL7BB3o5UNeJ2WUwlbbAs5Uosw4IPZG4Y5K Mm.K53gGx6mVKEKkW9u9GTvNMCZWOHQoyxvUpVGtpEGbuho8pq6lEoYIiFmv laUdoKZaPvhEDOo5Y3tbn.cism14mEaLA62ynArMAjK2e8p3gE2ORRF2_hZx A1bXlHVdt.GZqpHJxJHJGvD5EQhVBv3Me1Z155F.qDxntflW3Dlbv48jyCcv LJBPjS2TB4Q-- X-Yahoo-Newman-Property: ymail-3 From: Marek Lindner To: "The list for a Better Approach To Mobile Ad-hoc Networking" Date: Mon, 16 Aug 2010 18:51:42 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.32-5-amd64; KDE/4.4.5; x86_64; ; ) References: <4C6437BF.9080909@web.de> <201008141926.57132.lindner_marek@yahoo.de> In-Reply-To: <201008141926.57132.lindner_marek@yahoo.de> MIME-Version: 1.0 Message-Id: <201008161851.43816.lindner_marek@yahoo.de> Subject: Re: [B.A.T.M.A.N.] Problem openWRT "backfire" and "kmod-batman-adv" X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 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: Mon, 16 Aug 2010 16:52:12 -0000 On Saturday 14 August 2010 19:26:56 Marek Lindner wrote: > Could you please copy the attached patch into your batman-advanced patches > folder and verify whether it fixes your problem ? This document explains > the location of that folder and how to rebuild the package: Here is the updated notify patch plus another patch which might solve the issue. These are the patches posted by Sven but backported to 2000.0.0 and prepared for OpenWRT. Please try the notify patch first and if it does not work add the dev_hold patch and let us know how it goes. Regards, Marek --- a/hard-interface.c +++ b/hard-interface.c @@ -213,7 +213,6 @@ static void hardif_activate_interface(struct batman_if *batman_if) if (batman_if->if_status != IF_INACTIVE) return; - dev_hold(batman_if->net_dev); update_mac_addresses(batman_if); batman_if->if_status = IF_TO_BE_ACTIVATED; @@ -238,8 +237,6 @@ static void hardif_deactivate_interface(struct batman_if *batman_if) (batman_if->if_status != IF_TO_BE_ACTIVATED)) return; - dev_put(batman_if->net_dev); - batman_if->if_status = IF_INACTIVE; bat_info(batman_if->soft_iface, "Interface deactivated: %s\n", @@ -385,12 +382,14 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev) if (ret != 1) goto out; + dev_hold(net_dev); + batman_if = kmalloc(sizeof(struct batman_if), GFP_ATOMIC); if (!batman_if) { printk(KERN_ERR "batman-adv:" "Can't add interface (%s): out of memory\n", net_dev->name); - goto out; + goto release_dev; } batman_if->dev = kstrdup(net_dev->name, GFP_ATOMIC); @@ -408,6 +407,8 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev) free_if: kfree(batman_if); +release_dev: + dev_put(net_dev); out: return NULL; } @@ -431,6 +432,7 @@ static void hardif_remove_interface(struct batman_if *batman_if) batman_if->if_status = IF_TO_BE_REMOVED; list_del_rcu(&batman_if->list); sysfs_del_hardif(&batman_if->hardif_obj); + dev_put(batman_if->net_dev); call_rcu(&batman_if->rcu, hardif_free_interface); }