diff options
-rw-r--r-- | drivers/net/ipvlan/ipvlan.h | 6 | ||||
-rw-r--r-- | drivers/net/ipvlan/ipvlan_main.c | 10 | ||||
-rw-r--r-- | include/linux/netdevice.h | 32 |
3 files changed, 20 insertions, 28 deletions
diff --git a/drivers/net/ipvlan/ipvlan.h b/drivers/net/ipvlan/ipvlan.h index a115f12bf130..c818b9bdab6e 100644 --- a/drivers/net/ipvlan/ipvlan.h +++ b/drivers/net/ipvlan/ipvlan.h | |||
@@ -177,4 +177,10 @@ int ipvlan_link_new(struct net *src_net, struct net_device *dev, | |||
177 | void ipvlan_link_delete(struct net_device *dev, struct list_head *head); | 177 | void ipvlan_link_delete(struct net_device *dev, struct list_head *head); |
178 | void ipvlan_link_setup(struct net_device *dev); | 178 | void ipvlan_link_setup(struct net_device *dev); |
179 | int ipvlan_link_register(struct rtnl_link_ops *ops); | 179 | int ipvlan_link_register(struct rtnl_link_ops *ops); |
180 | |||
181 | static inline bool netif_is_ipvlan_port(const struct net_device *dev) | ||
182 | { | ||
183 | return dev->rx_handler == ipvlan_handle_frame; | ||
184 | } | ||
185 | |||
180 | #endif /* __IPVLAN_H */ | 186 | #endif /* __IPVLAN_H */ |
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index 4cbe9e27287d..23fd5ab180e8 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c | |||
@@ -129,7 +129,6 @@ static int ipvlan_port_create(struct net_device *dev) | |||
129 | if (err) | 129 | if (err) |
130 | goto err; | 130 | goto err; |
131 | 131 | ||
132 | dev->priv_flags |= IFF_IPVLAN_MASTER; | ||
133 | return 0; | 132 | return 0; |
134 | 133 | ||
135 | err: | 134 | err: |
@@ -142,7 +141,6 @@ static void ipvlan_port_destroy(struct net_device *dev) | |||
142 | struct ipvl_port *port = ipvlan_port_get_rtnl(dev); | 141 | struct ipvl_port *port = ipvlan_port_get_rtnl(dev); |
143 | struct sk_buff *skb; | 142 | struct sk_buff *skb; |
144 | 143 | ||
145 | dev->priv_flags &= ~IFF_IPVLAN_MASTER; | ||
146 | if (port->mode == IPVLAN_MODE_L3S) { | 144 | if (port->mode == IPVLAN_MODE_L3S) { |
147 | dev->priv_flags &= ~IFF_L3MDEV_MASTER; | 145 | dev->priv_flags &= ~IFF_L3MDEV_MASTER; |
148 | ipvlan_unregister_nf_hook(dev_net(dev)); | 146 | ipvlan_unregister_nf_hook(dev_net(dev)); |
@@ -423,6 +421,12 @@ static const struct header_ops ipvlan_header_ops = { | |||
423 | .cache_update = eth_header_cache_update, | 421 | .cache_update = eth_header_cache_update, |
424 | }; | 422 | }; |
425 | 423 | ||
424 | static bool netif_is_ipvlan(const struct net_device *dev) | ||
425 | { | ||
426 | /* both ipvlan and ipvtap devices use the same netdev_ops */ | ||
427 | return dev->netdev_ops == &ipvlan_netdev_ops; | ||
428 | } | ||
429 | |||
426 | static int ipvlan_ethtool_get_link_ksettings(struct net_device *dev, | 430 | static int ipvlan_ethtool_get_link_ksettings(struct net_device *dev, |
427 | struct ethtool_link_ksettings *cmd) | 431 | struct ethtool_link_ksettings *cmd) |
428 | { | 432 | { |
@@ -600,8 +604,6 @@ int ipvlan_link_new(struct net *src_net, struct net_device *dev, | |||
600 | */ | 604 | */ |
601 | memcpy(dev->dev_addr, phy_dev->dev_addr, ETH_ALEN); | 605 | memcpy(dev->dev_addr, phy_dev->dev_addr, ETH_ALEN); |
602 | 606 | ||
603 | dev->priv_flags |= IFF_IPVLAN_SLAVE; | ||
604 | |||
605 | err = register_netdevice(dev); | 607 | err = register_netdevice(dev); |
606 | if (err < 0) | 608 | if (err < 0) |
607 | return err; | 609 | return err; |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index dbe6344b727a..95a613a7cc1c 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1381,8 +1381,6 @@ struct net_device_ops { | |||
1381 | * @IFF_MACVLAN: Macvlan device | 1381 | * @IFF_MACVLAN: Macvlan device |
1382 | * @IFF_XMIT_DST_RELEASE_PERM: IFF_XMIT_DST_RELEASE not taking into account | 1382 | * @IFF_XMIT_DST_RELEASE_PERM: IFF_XMIT_DST_RELEASE not taking into account |
1383 | * underlying stacked devices | 1383 | * underlying stacked devices |
1384 | * @IFF_IPVLAN_MASTER: IPvlan master device | ||
1385 | * @IFF_IPVLAN_SLAVE: IPvlan slave device | ||
1386 | * @IFF_L3MDEV_MASTER: device is an L3 master device | 1384 | * @IFF_L3MDEV_MASTER: device is an L3 master device |
1387 | * @IFF_NO_QUEUE: device can run without qdisc attached | 1385 | * @IFF_NO_QUEUE: device can run without qdisc attached |
1388 | * @IFF_OPENVSWITCH: device is a Open vSwitch master | 1386 | * @IFF_OPENVSWITCH: device is a Open vSwitch master |
@@ -1412,16 +1410,14 @@ enum netdev_priv_flags { | |||
1412 | IFF_LIVE_ADDR_CHANGE = 1<<15, | 1410 | IFF_LIVE_ADDR_CHANGE = 1<<15, |
1413 | IFF_MACVLAN = 1<<16, | 1411 | IFF_MACVLAN = 1<<16, |
1414 | IFF_XMIT_DST_RELEASE_PERM = 1<<17, | 1412 | IFF_XMIT_DST_RELEASE_PERM = 1<<17, |
1415 | IFF_IPVLAN_MASTER = 1<<18, | 1413 | IFF_L3MDEV_MASTER = 1<<18, |
1416 | IFF_IPVLAN_SLAVE = 1<<19, | 1414 | IFF_NO_QUEUE = 1<<19, |
1417 | IFF_L3MDEV_MASTER = 1<<20, | 1415 | IFF_OPENVSWITCH = 1<<20, |
1418 | IFF_NO_QUEUE = 1<<21, | 1416 | IFF_L3MDEV_SLAVE = 1<<21, |
1419 | IFF_OPENVSWITCH = 1<<22, | 1417 | IFF_TEAM = 1<<22, |
1420 | IFF_L3MDEV_SLAVE = 1<<23, | 1418 | IFF_RXFH_CONFIGURED = 1<<23, |
1421 | IFF_TEAM = 1<<24, | 1419 | IFF_PHONY_HEADROOM = 1<<24, |
1422 | IFF_RXFH_CONFIGURED = 1<<25, | 1420 | IFF_MACSEC = 1<<25, |
1423 | IFF_PHONY_HEADROOM = 1<<26, | ||
1424 | IFF_MACSEC = 1<<27, | ||
1425 | }; | 1421 | }; |
1426 | 1422 | ||
1427 | #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN | 1423 | #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN |
@@ -1442,8 +1438,6 @@ enum netdev_priv_flags { | |||
1442 | #define IFF_LIVE_ADDR_CHANGE IFF_LIVE_ADDR_CHANGE | 1438 | #define IFF_LIVE_ADDR_CHANGE IFF_LIVE_ADDR_CHANGE |
1443 | #define IFF_MACVLAN IFF_MACVLAN | 1439 | #define IFF_MACVLAN IFF_MACVLAN |
1444 | #define IFF_XMIT_DST_RELEASE_PERM IFF_XMIT_DST_RELEASE_PERM | 1440 | #define IFF_XMIT_DST_RELEASE_PERM IFF_XMIT_DST_RELEASE_PERM |
1445 | #define IFF_IPVLAN_MASTER IFF_IPVLAN_MASTER | ||
1446 | #define IFF_IPVLAN_SLAVE IFF_IPVLAN_SLAVE | ||
1447 | #define IFF_L3MDEV_MASTER IFF_L3MDEV_MASTER | 1441 | #define IFF_L3MDEV_MASTER IFF_L3MDEV_MASTER |
1448 | #define IFF_NO_QUEUE IFF_NO_QUEUE | 1442 | #define IFF_NO_QUEUE IFF_NO_QUEUE |
1449 | #define IFF_OPENVSWITCH IFF_OPENVSWITCH | 1443 | #define IFF_OPENVSWITCH IFF_OPENVSWITCH |
@@ -4223,16 +4217,6 @@ static inline bool netif_is_macvlan_port(const struct net_device *dev) | |||
4223 | return dev->priv_flags & IFF_MACVLAN_PORT; | 4217 | return dev->priv_flags & IFF_MACVLAN_PORT; |
4224 | } | 4218 | } |
4225 | 4219 | ||
4226 | static inline bool netif_is_ipvlan(const struct net_device *dev) | ||
4227 | { | ||
4228 | return dev->priv_flags & IFF_IPVLAN_SLAVE; | ||
4229 | } | ||
4230 | |||
4231 | static inline bool netif_is_ipvlan_port(const struct net_device *dev) | ||
4232 | { | ||
4233 | return dev->priv_flags & IFF_IPVLAN_MASTER; | ||
4234 | } | ||
4235 | |||
4236 | static inline bool netif_is_bond_master(const struct net_device *dev) | 4220 | static inline bool netif_is_bond_master(const struct net_device *dev) |
4237 | { | 4221 | { |
4238 | return dev->flags & IFF_MASTER && dev->priv_flags & IFF_BONDING; | 4222 | return dev->flags & IFF_MASTER && dev->priv_flags & IFF_BONDING; |