Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: always pass struct netdev_notifier_info to netdevice notifiers

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>

authored by

Cong Wang and committed by
David S. Miller
75538c2b 06ecf24b

+21 -11
+6
include/linux/netdevice.h
··· 1609 1609 unsigned int flags_changed; 1610 1610 }; 1611 1611 1612 + static inline void netdev_notifier_info_init(struct netdev_notifier_info *info, 1613 + struct net_device *dev) 1614 + { 1615 + info->dev = dev; 1616 + } 1617 + 1612 1618 static inline struct net_device * 1613 1619 netdev_notifier_info_to_dev(const struct netdev_notifier_info *info) 1614 1620 {
+3 -1
net/atm/clip.c
··· 575 575 void *ifa) 576 576 { 577 577 struct in_device *in_dev; 578 + struct netdev_notifier_info info; 578 579 579 580 in_dev = ((struct in_ifaddr *)ifa)->ifa_dev; 580 581 /* ··· 584 583 */ 585 584 if (event != NETDEV_UP) 586 585 return NOTIFY_DONE; 587 - return clip_device_event(this, NETDEV_CHANGE, in_dev->dev); 586 + netdev_notifier_info_init(&info, in_dev->dev); 587 + return clip_device_event(this, NETDEV_CHANGE, &info); 588 588 } 589 589 590 590 static struct notifier_block clip_dev_notifier = {
-6
net/core/dev.c
··· 1391 1391 } 1392 1392 EXPORT_SYMBOL(dev_disable_lro); 1393 1393 1394 - static void netdev_notifier_info_init(struct netdev_notifier_info *info, 1395 - struct net_device *dev) 1396 - { 1397 - info->dev = dev; 1398 - } 1399 - 1400 1394 static int call_netdevice_notifier(struct notifier_block *nb, unsigned long val, 1401 1395 struct net_device *dev) 1402 1396 {
+4 -1
net/ipv4/netfilter/ipt_MASQUERADE.c
··· 129 129 void *ptr) 130 130 { 131 131 struct net_device *dev = ((struct in_ifaddr *)ptr)->ifa_dev->dev; 132 - return masq_device_event(this, event, dev); 132 + struct netdev_notifier_info info; 133 + 134 + netdev_notifier_info_init(&info, dev); 135 + return masq_device_event(this, event, &info); 133 136 } 134 137 135 138 static struct notifier_block masq_dev_notifier = {
+5 -2
net/ipv6/addrconf.c
··· 4645 4645 4646 4646 static void dev_disable_change(struct inet6_dev *idev) 4647 4647 { 4648 + struct netdev_notifier_info info; 4649 + 4648 4650 if (!idev || !idev->dev) 4649 4651 return; 4650 4652 4653 + netdev_notifier_info_init(&info, idev->dev); 4651 4654 if (idev->cnf.disable_ipv6) 4652 - addrconf_notify(NULL, NETDEV_DOWN, idev->dev); 4655 + addrconf_notify(NULL, NETDEV_DOWN, &info); 4653 4656 else 4654 - addrconf_notify(NULL, NETDEV_UP, idev->dev); 4657 + addrconf_notify(NULL, NETDEV_UP, &info); 4655 4658 } 4656 4659 4657 4660 static void addrconf_disable_change(struct net *net, __s32 newf)
+3 -1
net/ipv6/netfilter/ip6t_MASQUERADE.c
··· 89 89 unsigned long event, void *ptr) 90 90 { 91 91 struct inet6_ifaddr *ifa = ptr; 92 + struct netdev_notifier_info info; 92 93 93 - return masq_device_event(this, event, ifa->idev->dev); 94 + netdev_notifier_info_init(&info, ifa->idev->dev); 95 + return masq_device_event(this, event, &info); 94 96 } 95 97 96 98 static struct notifier_block masq_inet_notifier = {