Commit 93d9b7d7 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

net: rename notifier defines for netdev type change

Since generally there could be more netdevices changing type other
than bonding, making this event type name "bonding-unrelated"
Signed-off-by: default avatarJiri Pirko <jpirko@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1e94d72f
...@@ -1480,14 +1480,16 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1480,14 +1480,16 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
bond_dev->name, bond_dev->name,
bond_dev->type, slave_dev->type); bond_dev->type, slave_dev->type);
netdev_bonding_change(bond_dev, NETDEV_BONDING_OLDTYPE); netdev_bonding_change(bond_dev,
NETDEV_PRE_TYPE_CHANGE);
if (slave_dev->type != ARPHRD_ETHER) if (slave_dev->type != ARPHRD_ETHER)
bond_setup_by_slave(bond_dev, slave_dev); bond_setup_by_slave(bond_dev, slave_dev);
else else
ether_setup(bond_dev); ether_setup(bond_dev);
netdev_bonding_change(bond_dev, NETDEV_BONDING_NEWTYPE); netdev_bonding_change(bond_dev,
NETDEV_POST_TYPE_CHANGE);
} }
} else if (bond_dev->type != slave_dev->type) { } else if (bond_dev->type != slave_dev->type) {
pr_err("%s ether type (%d) is different from other slaves (%d), can not enslave it.\n", pr_err("%s ether type (%d) is different from other slaves (%d), can not enslave it.\n",
......
...@@ -199,8 +199,8 @@ static inline int notifier_to_errno(int ret) ...@@ -199,8 +199,8 @@ static inline int notifier_to_errno(int ret)
#define NETDEV_FEAT_CHANGE 0x000B #define NETDEV_FEAT_CHANGE 0x000B
#define NETDEV_BONDING_FAILOVER 0x000C #define NETDEV_BONDING_FAILOVER 0x000C
#define NETDEV_PRE_UP 0x000D #define NETDEV_PRE_UP 0x000D
#define NETDEV_BONDING_OLDTYPE 0x000E #define NETDEV_PRE_TYPE_CHANGE 0x000E
#define NETDEV_BONDING_NEWTYPE 0x000F #define NETDEV_POST_TYPE_CHANGE 0x000F
#define NETDEV_POST_INIT 0x0010 #define NETDEV_POST_INIT 0x0010
#define NETDEV_UNREGISTER_BATCH 0x0011 #define NETDEV_UNREGISTER_BATCH 0x0011
......
...@@ -1095,10 +1095,10 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, ...@@ -1095,10 +1095,10 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
case NETDEV_DOWN: case NETDEV_DOWN:
ip_mc_down(in_dev); ip_mc_down(in_dev);
break; break;
case NETDEV_BONDING_OLDTYPE: case NETDEV_PRE_TYPE_CHANGE:
ip_mc_unmap(in_dev); ip_mc_unmap(in_dev);
break; break;
case NETDEV_BONDING_NEWTYPE: case NETDEV_POST_TYPE_CHANGE:
ip_mc_remap(in_dev); ip_mc_remap(in_dev);
break; break;
case NETDEV_CHANGEMTU: case NETDEV_CHANGEMTU:
......
...@@ -137,7 +137,7 @@ static DEFINE_SPINLOCK(addrconf_verify_lock); ...@@ -137,7 +137,7 @@ static DEFINE_SPINLOCK(addrconf_verify_lock);
static void addrconf_join_anycast(struct inet6_ifaddr *ifp); static void addrconf_join_anycast(struct inet6_ifaddr *ifp);
static void addrconf_leave_anycast(struct inet6_ifaddr *ifp); static void addrconf_leave_anycast(struct inet6_ifaddr *ifp);
static void addrconf_bonding_change(struct net_device *dev, static void addrconf_type_change(struct net_device *dev,
unsigned long event); unsigned long event);
static int addrconf_ifdown(struct net_device *dev, int how); static int addrconf_ifdown(struct net_device *dev, int how);
...@@ -2584,9 +2584,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, ...@@ -2584,9 +2584,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
return notifier_from_errno(err); return notifier_from_errno(err);
} }
break; break;
case NETDEV_BONDING_OLDTYPE: case NETDEV_PRE_TYPE_CHANGE:
case NETDEV_BONDING_NEWTYPE: case NETDEV_POST_TYPE_CHANGE:
addrconf_bonding_change(dev, event); addrconf_type_change(dev, event);
break; break;
} }
...@@ -2601,16 +2601,16 @@ static struct notifier_block ipv6_dev_notf = { ...@@ -2601,16 +2601,16 @@ static struct notifier_block ipv6_dev_notf = {
.priority = 0 .priority = 0
}; };
static void addrconf_bonding_change(struct net_device *dev, unsigned long event) static void addrconf_type_change(struct net_device *dev, unsigned long event)
{ {
struct inet6_dev *idev; struct inet6_dev *idev;
ASSERT_RTNL(); ASSERT_RTNL();
idev = __in6_dev_get(dev); idev = __in6_dev_get(dev);
if (event == NETDEV_BONDING_NEWTYPE) if (event == NETDEV_POST_TYPE_CHANGE)
ipv6_mc_remap(idev); ipv6_mc_remap(idev);
else if (event == NETDEV_BONDING_OLDTYPE) else if (event == NETDEV_PRE_TYPE_CHANGE)
ipv6_mc_unmap(idev); ipv6_mc_unmap(idev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment