]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net: always pass struct netdev_notifier_info to netdevice notifiers
authorCong Wang <amwang@redhat.com>
Wed, 29 May 2013 03:30:50 +0000 (11:30 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 May 2013 04:58:54 +0000 (21:58 -0700)
commit 351638e7deeed2ec8ce451b53d3 (net: pass info struct via netdevice notifier)
breaks booting of my KVM guest, this is due to we still forget to pass
struct netdev_notifier_info in several places. This patch completes it.

Cc: Jiri Pirko <jiri@resnulli.us>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
net/atm/clip.c
net/core/dev.c
net/ipv4/netfilter/ipt_MASQUERADE.c
net/ipv6/addrconf.c
net/ipv6/netfilter/ip6t_MASQUERADE.c

index 850271809a9ec5ec442ff9a1b22abcd596b20049..8f967e34142baf961a082ebcd43e1092883b227f 100644 (file)
@@ -1609,6 +1609,12 @@ struct netdev_notifier_change_info {
        unsigned int flags_changed;
 };
 
        unsigned int flags_changed;
 };
 
+static inline void netdev_notifier_info_init(struct netdev_notifier_info *info,
+                                            struct net_device *dev)
+{
+       info->dev = dev;
+}
+
 static inline struct net_device *
 netdev_notifier_info_to_dev(const struct netdev_notifier_info *info)
 {
 static inline struct net_device *
 netdev_notifier_info_to_dev(const struct netdev_notifier_info *info)
 {
index cce241eb01d94547f399a154270a9dd778d1570a..8215f7cb170b5a21cdb67347f50578f57e515dfb 100644 (file)
@@ -575,6 +575,7 @@ static int clip_inet_event(struct notifier_block *this, unsigned long event,
                           void *ifa)
 {
        struct in_device *in_dev;
                           void *ifa)
 {
        struct in_device *in_dev;
+       struct netdev_notifier_info info;
 
        in_dev = ((struct in_ifaddr *)ifa)->ifa_dev;
        /*
 
        in_dev = ((struct in_ifaddr *)ifa)->ifa_dev;
        /*
@@ -583,7 +584,8 @@ static int clip_inet_event(struct notifier_block *this, unsigned long event,
         */
        if (event != NETDEV_UP)
                return NOTIFY_DONE;
         */
        if (event != NETDEV_UP)
                return NOTIFY_DONE;
-       return clip_device_event(this, NETDEV_CHANGE, in_dev->dev);
+       netdev_notifier_info_init(&info, in_dev->dev);
+       return clip_device_event(this, NETDEV_CHANGE, &info);
 }
 
 static struct notifier_block clip_dev_notifier = {
 }
 
 static struct notifier_block clip_dev_notifier = {
index 6eb621cc3b8144a5359e42fd67f258e165853be5..b2e9057be3bfe5615770ec605c0e20b51558065d 100644 (file)
@@ -1391,12 +1391,6 @@ void dev_disable_lro(struct net_device *dev)
 }
 EXPORT_SYMBOL(dev_disable_lro);
 
 }
 EXPORT_SYMBOL(dev_disable_lro);
 
-static void netdev_notifier_info_init(struct netdev_notifier_info *info,
-                                     struct net_device *dev)
-{
-       info->dev = dev;
-}
-
 static int call_netdevice_notifier(struct notifier_block *nb, unsigned long val,
                                   struct net_device *dev)
 {
 static int call_netdevice_notifier(struct notifier_block *nb, unsigned long val,
                                   struct net_device *dev)
 {
index dd5508bde799706c3f5a9fd41561b2b9c296e110..30e4de94056722535ee5304e93b49bfb6c5cf889 100644 (file)
@@ -129,7 +129,10 @@ static int masq_inet_event(struct notifier_block *this,
                           void *ptr)
 {
        struct net_device *dev = ((struct in_ifaddr *)ptr)->ifa_dev->dev;
                           void *ptr)
 {
        struct net_device *dev = ((struct in_ifaddr *)ptr)->ifa_dev->dev;
-       return masq_device_event(this, event, dev);
+       struct netdev_notifier_info info;
+
+       netdev_notifier_info_init(&info, dev);
+       return masq_device_event(this, event, &info);
 }
 
 static struct notifier_block masq_dev_notifier = {
 }
 
 static struct notifier_block masq_dev_notifier = {
index bce073b4bbd43824d17abc82e4d55e9779f44a7d..7b34f06af344838de37e3af4bbd9117995113045 100644 (file)
@@ -4645,13 +4645,16 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write,
 
 static void dev_disable_change(struct inet6_dev *idev)
 {
 
 static void dev_disable_change(struct inet6_dev *idev)
 {
+       struct netdev_notifier_info info;
+
        if (!idev || !idev->dev)
                return;
 
        if (!idev || !idev->dev)
                return;
 
+       netdev_notifier_info_init(&info, idev->dev);
        if (idev->cnf.disable_ipv6)
        if (idev->cnf.disable_ipv6)
-               addrconf_notify(NULL, NETDEV_DOWN, idev->dev);
+               addrconf_notify(NULL, NETDEV_DOWN, &info);
        else
        else
-               addrconf_notify(NULL, NETDEV_UP, idev->dev);
+               addrconf_notify(NULL, NETDEV_UP, &info);
 }
 
 static void addrconf_disable_change(struct net *net, __s32 newf)
 }
 
 static void addrconf_disable_change(struct net *net, __s32 newf)
index b76257cd7e1e6b9f8a99d9ece7c88b14e376f540..47bff610751922ebd80b21eb59387a334af9b3fb 100644 (file)
@@ -89,8 +89,10 @@ static int masq_inet_event(struct notifier_block *this,
                           unsigned long event, void *ptr)
 {
        struct inet6_ifaddr *ifa = ptr;
                           unsigned long event, void *ptr)
 {
        struct inet6_ifaddr *ifa = ptr;
+       struct netdev_notifier_info info;
 
 
-       return masq_device_event(this, event, ifa->idev->dev);
+       netdev_notifier_info_init(&info, ifa->idev->dev);
+       return masq_device_event(this, event, &info);
 }
 
 static struct notifier_block masq_inet_notifier = {
 }
 
 static struct notifier_block masq_inet_notifier = {