Skip to content

Commit 007979e

Browse files
David Aherndavem330
authored andcommitted
net: Rename IFF_VRF_MASTER to IFF_L3MDEV_MASTER
Rename IFF_VRF_MASTER to IFF_L3MDEV_MASTER and update the name of the netif_is_vrf and netif_index_is_vrf macros. Signed-off-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e6934f3 commit 007979e

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

drivers/net/vrf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ static int do_vrf_add_slave(struct net_device *dev, struct net_device *port_dev)
438438

439439
static int vrf_add_slave(struct net_device *dev, struct net_device *port_dev)
440440
{
441-
if (netif_is_vrf(port_dev) || vrf_is_slave(port_dev))
441+
if (netif_is_l3_master(port_dev) || vrf_is_slave(port_dev))
442442
return -EINVAL;
443443

444444
return do_vrf_add_slave(dev, port_dev);
@@ -591,7 +591,7 @@ static int vrf_newlink(struct net *src_net, struct net_device *dev,
591591

592592
vrf->tb_id = nla_get_u32(data[IFLA_VRF_TABLE]);
593593

594-
dev->priv_flags |= IFF_VRF_MASTER;
594+
dev->priv_flags |= IFF_L3MDEV_MASTER;
595595

596596
err = -ENOMEM;
597597
vrf_ptr = kmalloc(sizeof(*dev->vrf_ptr), GFP_KERNEL);
@@ -657,7 +657,7 @@ static int vrf_device_event(struct notifier_block *unused,
657657
struct net_vrf_dev *vrf_ptr = rtnl_dereference(dev->vrf_ptr);
658658
struct net_device *vrf_dev;
659659

660-
if (!vrf_ptr || netif_is_vrf(dev))
660+
if (!vrf_ptr || netif_is_l3_master(dev))
661661
goto out;
662662

663663
vrf_dev = netdev_master_upper_dev_get(dev);

include/linux/netdevice.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,7 @@ struct net_device_ops {
12581258
* @IFF_LIVE_ADDR_CHANGE: device supports hardware address
12591259
* change when it's running
12601260
* @IFF_MACVLAN: Macvlan device
1261-
* @IFF_VRF_MASTER: device is a VRF master
1261+
* @IFF_L3MDEV_MASTER: device is an L3 master device
12621262
* @IFF_NO_QUEUE: device can run without qdisc attached
12631263
* @IFF_OPENVSWITCH: device is a Open vSwitch master
12641264
*/
@@ -1283,7 +1283,7 @@ enum netdev_priv_flags {
12831283
IFF_XMIT_DST_RELEASE_PERM = 1<<17,
12841284
IFF_IPVLAN_MASTER = 1<<18,
12851285
IFF_IPVLAN_SLAVE = 1<<19,
1286-
IFF_VRF_MASTER = 1<<20,
1286+
IFF_L3MDEV_MASTER = 1<<20,
12871287
IFF_NO_QUEUE = 1<<21,
12881288
IFF_OPENVSWITCH = 1<<22,
12891289
};
@@ -1308,7 +1308,7 @@ enum netdev_priv_flags {
13081308
#define IFF_XMIT_DST_RELEASE_PERM IFF_XMIT_DST_RELEASE_PERM
13091309
#define IFF_IPVLAN_MASTER IFF_IPVLAN_MASTER
13101310
#define IFF_IPVLAN_SLAVE IFF_IPVLAN_SLAVE
1311-
#define IFF_VRF_MASTER IFF_VRF_MASTER
1311+
#define IFF_L3MDEV_MASTER IFF_L3MDEV_MASTER
13121312
#define IFF_NO_QUEUE IFF_NO_QUEUE
13131313
#define IFF_OPENVSWITCH IFF_OPENVSWITCH
13141314

@@ -3824,9 +3824,9 @@ static inline bool netif_supports_nofcs(struct net_device *dev)
38243824
return dev->priv_flags & IFF_SUPP_NOFCS;
38253825
}
38263826

3827-
static inline bool netif_is_vrf(const struct net_device *dev)
3827+
static inline bool netif_is_l3_master(const struct net_device *dev)
38283828
{
3829-
return dev->priv_flags & IFF_VRF_MASTER;
3829+
return dev->priv_flags & IFF_L3MDEV_MASTER;
38303830
}
38313831

38323832
static inline bool netif_is_bridge_master(const struct net_device *dev)
@@ -3839,7 +3839,7 @@ static inline bool netif_is_ovs_master(const struct net_device *dev)
38393839
return dev->priv_flags & IFF_OPENVSWITCH;
38403840
}
38413841

3842-
static inline bool netif_index_is_vrf(struct net *net, int ifindex)
3842+
static inline bool netif_index_is_l3_master(struct net *net, int ifindex)
38433843
{
38443844
bool rc = false;
38453845

@@ -3853,7 +3853,7 @@ static inline bool netif_index_is_vrf(struct net *net, int ifindex)
38533853

38543854
dev = dev_get_by_index_rcu(net, ifindex);
38553855
if (dev)
3856-
rc = netif_is_vrf(dev);
3856+
rc = netif_is_l3_master(dev);
38573857

38583858
rcu_read_unlock();
38593859
#endif

include/net/route.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32
256256
if (inet_sk(sk)->transparent)
257257
flow_flags |= FLOWI_FLAG_ANYSRC;
258258

259-
if (netif_index_is_vrf(sock_net(sk), oif))
259+
if (netif_index_is_l3_master(sock_net(sk), oif))
260260
flow_flags |= FLOWI_FLAG_VRFSRC | FLOWI_FLAG_SKIP_NH_OIF;
261261

262262
flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE,

include/net/vrf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static inline int vrf_master_ifindex_rcu(const struct net_device *dev)
4343
if (!dev)
4444
return 0;
4545

46-
if (netif_is_vrf(dev)) {
46+
if (netif_is_l3_master(dev)) {
4747
ifindex = dev->ifindex;
4848
} else {
4949
vrf_ptr = rcu_dereference(dev->vrf_ptr);
@@ -125,7 +125,7 @@ static inline u32 vrf_dev_table_rtnl(const struct net_device *dev)
125125
return tb_id;
126126
}
127127

128-
/* caller has already checked netif_is_vrf(dev) */
128+
/* caller has already checked netif_is_l3_master(dev) */
129129
static inline struct rtable *vrf_dev_get_rth(const struct net_device *dev)
130130
{
131131
struct rtable *rth = ERR_PTR(-ENETUNREACH);

net/ipv4/ip_output.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb,
15711571
}
15721572

15731573
oif = arg->bound_dev_if;
1574-
if (!oif && netif_index_is_vrf(net, skb->skb_iif))
1574+
if (!oif && netif_index_is_l3_master(net, skb->skb_iif))
15751575
oif = skb->skb_iif;
15761576

15771577
flowi4_init_output(&fl4, oif,

net/ipv4/route.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2124,7 +2124,7 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4)
21242124
fl4->saddr = inet_select_addr(dev_out, 0,
21252125
RT_SCOPE_HOST);
21262126
}
2127-
if (netif_is_vrf(dev_out) &&
2127+
if (netif_is_l3_master(dev_out) &&
21282128
!(fl4->flowi4_flags & FLOWI_FLAG_VRFSRC)) {
21292129
rth = vrf_dev_get_rth(dev_out);
21302130
goto out;

net/ipv4/udp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
10211021
* device lookup source address from VRF table. This mimics
10221022
* behavior of ip_route_connect{_init}.
10231023
*/
1024-
if (netif_index_is_vrf(net, ipc.oif)) {
1024+
if (netif_index_is_l3_master(net, ipc.oif)) {
10251025
flowi4_init_output(fl4, ipc.oif, sk->sk_mark, tos,
10261026
RT_SCOPE_UNIVERSE, sk->sk_protocol,
10271027
(flow_flags | FLOWI_FLAG_VRFSRC |

0 commit comments

Comments
 (0)