mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-12 12:22:42 +00:00
Merge branch 'l2tpeth-info'
Guillaume Nault says: ==================== l2tp: add informations about l2tpeth interfaces in /sys Patch #1 lets userspace retrieve the naming scheme of an l2tpeth interface, using /sys/class/net/<iface>/name_assign_type. Patch #2 adds the DEVTYPE field in /sys/class/net/<iface>/uevent so that userspace can reliably know if a device is an l2tpeth interface. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
36784277c5
@ -130,8 +130,13 @@ static const struct net_device_ops l2tp_eth_netdev_ops = {
|
|||||||
.ndo_set_mac_address = eth_mac_addr,
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct device_type l2tpeth_type = {
|
||||||
|
.name = "l2tpeth",
|
||||||
|
};
|
||||||
|
|
||||||
static void l2tp_eth_dev_setup(struct net_device *dev)
|
static void l2tp_eth_dev_setup(struct net_device *dev)
|
||||||
{
|
{
|
||||||
|
SET_NETDEV_DEVTYPE(dev, &l2tpeth_type);
|
||||||
ether_setup(dev);
|
ether_setup(dev);
|
||||||
dev->priv_flags &= ~IFF_TX_SKB_SHARING;
|
dev->priv_flags &= ~IFF_TX_SKB_SHARING;
|
||||||
dev->features |= NETIF_F_LLTX;
|
dev->features |= NETIF_F_LLTX;
|
||||||
@ -258,6 +263,7 @@ static void l2tp_eth_adjust_mtu(struct l2tp_tunnel *tunnel,
|
|||||||
|
|
||||||
static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 peer_session_id, struct l2tp_session_cfg *cfg)
|
static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 peer_session_id, struct l2tp_session_cfg *cfg)
|
||||||
{
|
{
|
||||||
|
unsigned char name_assign_type;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
char name[IFNAMSIZ];
|
char name[IFNAMSIZ];
|
||||||
struct l2tp_tunnel *tunnel;
|
struct l2tp_tunnel *tunnel;
|
||||||
@ -281,8 +287,11 @@ static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 p
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
strlcpy(name, cfg->ifname, IFNAMSIZ);
|
strlcpy(name, cfg->ifname, IFNAMSIZ);
|
||||||
} else
|
name_assign_type = NET_NAME_USER;
|
||||||
|
} else {
|
||||||
strcpy(name, L2TP_ETH_DEV_NAME);
|
strcpy(name, L2TP_ETH_DEV_NAME);
|
||||||
|
name_assign_type = NET_NAME_ENUM;
|
||||||
|
}
|
||||||
|
|
||||||
session = l2tp_session_create(sizeof(*spriv), tunnel, session_id,
|
session = l2tp_session_create(sizeof(*spriv), tunnel, session_id,
|
||||||
peer_session_id, cfg);
|
peer_session_id, cfg);
|
||||||
@ -291,7 +300,7 @@ static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 p
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev = alloc_netdev(sizeof(*priv), name, NET_NAME_UNKNOWN,
|
dev = alloc_netdev(sizeof(*priv), name, name_assign_type,
|
||||||
l2tp_eth_dev_setup);
|
l2tp_eth_dev_setup);
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user