|
@@ -1289,6 +1289,7 @@ enum netdev_priv_flags {
|
|
IFF_XMIT_DST_RELEASE_PERM = 1<<22,
|
|
IFF_XMIT_DST_RELEASE_PERM = 1<<22,
|
|
IFF_IPVLAN_MASTER = 1<<23,
|
|
IFF_IPVLAN_MASTER = 1<<23,
|
|
IFF_IPVLAN_SLAVE = 1<<24,
|
|
IFF_IPVLAN_SLAVE = 1<<24,
|
|
|
|
+ IFF_VRF_MASTER = 1<<25,
|
|
};
|
|
};
|
|
|
|
|
|
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
|
|
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
|
|
@@ -1316,6 +1317,7 @@ enum netdev_priv_flags {
|
|
#define IFF_XMIT_DST_RELEASE_PERM IFF_XMIT_DST_RELEASE_PERM
|
|
#define IFF_XMIT_DST_RELEASE_PERM IFF_XMIT_DST_RELEASE_PERM
|
|
#define IFF_IPVLAN_MASTER IFF_IPVLAN_MASTER
|
|
#define IFF_IPVLAN_MASTER IFF_IPVLAN_MASTER
|
|
#define IFF_IPVLAN_SLAVE IFF_IPVLAN_SLAVE
|
|
#define IFF_IPVLAN_SLAVE IFF_IPVLAN_SLAVE
|
|
|
|
+#define IFF_VRF_MASTER IFF_VRF_MASTER
|
|
|
|
|
|
/**
|
|
/**
|
|
* struct net_device - The DEVICE structure.
|
|
* struct net_device - The DEVICE structure.
|
|
@@ -1432,6 +1434,7 @@ enum netdev_priv_flags {
|
|
* @dn_ptr: DECnet specific data
|
|
* @dn_ptr: DECnet specific data
|
|
* @ip6_ptr: IPv6 specific data
|
|
* @ip6_ptr: IPv6 specific data
|
|
* @ax25_ptr: AX.25 specific data
|
|
* @ax25_ptr: AX.25 specific data
|
|
|
|
+ * @vrf_ptr: VRF specific data
|
|
* @ieee80211_ptr: IEEE 802.11 specific data, assign before registering
|
|
* @ieee80211_ptr: IEEE 802.11 specific data, assign before registering
|
|
*
|
|
*
|
|
* @last_rx: Time of last Rx
|
|
* @last_rx: Time of last Rx
|
|
@@ -1650,6 +1653,7 @@ struct net_device {
|
|
struct dn_dev __rcu *dn_ptr;
|
|
struct dn_dev __rcu *dn_ptr;
|
|
struct inet6_dev __rcu *ip6_ptr;
|
|
struct inet6_dev __rcu *ip6_ptr;
|
|
void *ax25_ptr;
|
|
void *ax25_ptr;
|
|
|
|
+ struct net_vrf_dev __rcu *vrf_ptr;
|
|
struct wireless_dev *ieee80211_ptr;
|
|
struct wireless_dev *ieee80211_ptr;
|
|
struct wpan_dev *ieee802154_ptr;
|
|
struct wpan_dev *ieee802154_ptr;
|
|
#if IS_ENABLED(CONFIG_MPLS_ROUTING)
|
|
#if IS_ENABLED(CONFIG_MPLS_ROUTING)
|
|
@@ -3808,6 +3812,22 @@ static inline bool netif_supports_nofcs(struct net_device *dev)
|
|
return dev->priv_flags & IFF_SUPP_NOFCS;
|
|
return dev->priv_flags & IFF_SUPP_NOFCS;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static inline bool netif_is_vrf(const struct net_device *dev)
|
|
|
|
+{
|
|
|
|
+ return dev->priv_flags & IFF_VRF_MASTER;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline bool netif_index_is_vrf(struct net *net, int ifindex)
|
|
|
|
+{
|
|
|
|
+ struct net_device *dev = dev_get_by_index_rcu(net, ifindex);
|
|
|
|
+ bool rc = false;
|
|
|
|
+
|
|
|
|
+ if (dev)
|
|
|
|
+ rc = netif_is_vrf(dev);
|
|
|
|
+
|
|
|
|
+ return rc;
|
|
|
|
+}
|
|
|
|
+
|
|
/* This device needs to keep skb dst for qdisc enqueue or ndo_start_xmit() */
|
|
/* This device needs to keep skb dst for qdisc enqueue or ndo_start_xmit() */
|
|
static inline void netif_keep_dst(struct net_device *dev)
|
|
static inline void netif_keep_dst(struct net_device *dev)
|
|
{
|
|
{
|