source: packages/net/batman-advanced/patches/0003-batman-adv-Create-batman_if-only-on-register-event.patch @ 22823

Last change on this file since 22823 was 22823, checked in by marek, 6 years ago

batman-adv: adding stability patches

Signed-off-by: Marek Lindner <lindner_marek@…>

File size: 1.5 KB
  • hard-interface.c

    From 3bb2899bd37b1bb127adaa6808f4b1fa716df0de Mon Sep 17 00:00:00 2001
    From: Sven Eckelmann <sven.eckelmann@gmx.de>
    Date: Fri, 20 Aug 2010 19:16:00 +0000
    Subject: [PATCH 08/10] batman-adv: Create batman_if only on register event
    
    We try to get all events for all net_devices to be able to add special
    sysfs folders for the batman-adv configuration. This also includes such
    events like NETDEV_POST_INIT which has no valid kobject according to
    v2.6.32-rc3-13-g7ffbe3f. This would create an oops in that situation.
    
    It is enough to create the batman_if only on NETDEV_REGISTER events
    because we will also receive those events for devices which already
    existed when we registered the notifier call.
    
    Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
    Cc: stable <stable@kernel.org>
    ---
     hard-interface.c |    6 ++----
     1 files changed, 2 insertions(+), 4 deletions(-)
    
    diff --git a/hard-interface.c b/hard-interface.c
    index e3e1e9e..1670ec8 100644
    a b static int hard_if_event(struct notifier_block *this, 
    395395        /* FIXME: each batman_if will be attached to a softif */ 
    396396        struct bat_priv *bat_priv = netdev_priv(soft_device); 
    397397 
    398         if (!batman_if) 
    399                 batman_if = hardif_add_interface(net_dev); 
     398        if (!batman_if && event == NETDEV_REGISTER) 
     399                        batman_if = hardif_add_interface(net_dev); 
    400400 
    401401        if (!batman_if) 
    402402                goto out; 
    403403 
    404404        switch (event) { 
    405         case NETDEV_REGISTER: 
    406                 break; 
    407405        case NETDEV_UP: 
    408406                hardif_activate_interface(soft_device, bat_priv, batman_if); 
    409407                break; 
Note: See TracBrowser for help on using the repository browser.