b.a.t.m.a.n.lists.open-mesh.org archive mirror
 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.] Problem openWRT "backfire" and "kmod-batman-adv"
Date: Mon, 16 Aug 2010 18:51:42 +0200	[thread overview]
Message-ID: <201008161851.43816.lindner_marek@yahoo.de> (raw)
In-Reply-To: <201008141926.57132.lindner_marek@yahoo.de>

[-- Attachment #1: Type: Text/Plain, Size: 574 bytes --]

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

[-- Attachment #2: 01-notify.patch --]
[-- Type: text/x-patch, Size: 534 bytes --]

--- a/hard-interface.c
+++ b/hard-interface.c
@@ -457,15 +457,13 @@ static int hard_if_event(struct notifier_block *this,
 	struct batman_if *batman_if = get_batman_if_by_netdev(net_dev);
 	struct bat_priv *bat_priv;
 
-	if (!batman_if)
-		batman_if = hardif_add_interface(net_dev);
+	if (!batman_if && event == NETDEV_REGISTER)
+			batman_if = hardif_add_interface(net_dev);
 
 	if (!batman_if)
 		goto out;
 
 	switch (event) {
-	case NETDEV_REGISTER:
-		break;
 	case NETDEV_UP:
 		hardif_activate_interface(batman_if);
 		break;


[-- Attachment #3: 02-dev_hold.patch --]
[-- Type: text/x-patch, Size: 1519 bytes --]

--- 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);
 }
 


  reply	other threads:[~2010-08-16 16:51 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-12 18:04 [B.A.T.M.A.N.] Problem openWRT "backfire" and "kmod-batman-adv" Tim Glaremin
2010-08-13  3:24 ` Sven Eckelmann
2010-08-20  7:29   ` [B.A.T.M.A.N.] problem openwrt-trunk + ath5k + batman-adv-devel in my case Lemonde
2010-08-20  9:00     ` Sven Eckelmann
2010-08-20 16:24     ` Marek Lindner
2010-08-20 17:08       ` [B.A.T.M.A.N.] Where do we stand on working systems? Jon Roland
     [not found]         ` <AANLkTim6yVL8q=fXoFOu23ZBMpqaMHiheCV13-6U99+s@mail.gmail.com>
2010-08-20 20:10           ` Jon Roland
2010-08-21  5:01       ` [B.A.T.M.A.N.] problem openwrt-trunk + ath5k + batman-adv-devel in my case Kazuki Shimada
2010-08-21  6:01         ` Marek Lindner
2010-08-26  6:51           ` Kazuki Shimada
2010-08-26  8:28             ` Sven Eckelmann
2010-08-27  2:20               ` Kazuki Shimada
2010-08-27  9:59                 ` Sven Eckelmann
2010-08-31  7:03                   ` Kazuki Shimada
2010-08-31  9:32                     ` Sven Eckelmann
     [not found]                       ` <4C7E22B2.1000707@bb.banban.jp>
2010-09-01 10:48                         ` Sven Eckelmann
2010-08-31 10:37                     ` Marek Lindner
2010-09-01 10:04                       ` Kazuki Shimada
2010-08-14 17:26 ` [B.A.T.M.A.N.] Problem openWRT "backfire" and "kmod-batman-adv" Marek Lindner
2010-08-16 16:51   ` Marek Lindner [this message]
     [not found] <mailman.33.1282337388.934.b.a.t.m.a.n@lists.open-mesh.org>
2010-08-21  8:09 ` Tim
2010-08-21  8:15   ` Sven Eckelmann
  -- strict thread matches above, loose matches on Subject: below --
2010-08-18  6:42 Tim
     [not found] ` <201008201211.51847.sven.eckelmann@gmx.de>
     [not found]   ` <4C6E8B79.7040801@web.de>
2010-08-20 14:44     ` Sven Eckelmann
2010-08-20 15:38       ` Sven Eckelmann
     [not found]       ` <4C6F5950.8070204@bb.banban.jp>
2010-08-21  6:19         ` Sven Eckelmann
2010-08-17  9:20 Tim
2010-08-17  9:27 ` Sven Eckelmann
2010-08-17  9:45   ` Tim
2010-08-17  9:51     ` Sven Eckelmann
2010-08-12 10:14 Tim Glaremin
2010-08-12 10:30 ` Marek Lindner
2010-08-12 10:32 ` Sven Eckelmann
     [not found] <mailman.1.1281002401.15834.b.a.t.m.a.n@lists.open-mesh.org>
2010-08-11 10:47 ` Tim
2010-08-11 11:14   ` Marek Lindner
2010-08-11 11:20   ` Sven Eckelmann
2010-08-11 14:23     ` Tim
2010-08-11 14:52       ` Sven Eckelmann
2010-08-04  9:21 Tim
2010-08-04  9:34 ` Sven Eckelmann
2010-08-04 22:03 ` 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=201008161851.43816.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;
as well as URLs for NNTP newsgroup(s).