diff options
author | Matt Johnston <matt@codeconstruct.com.au> | 2021-09-29 09:26:05 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-09-29 12:00:11 +0200 |
commit | f364dd71d92fe6722fe5d47803be974dc0c40762 (patch) | |
tree | 2ca01f13e26cf8d644c0f4e2a544de3c78e3c67f /net/mctp/device.c | |
parent | net: phy: micrel: Add support for LAN8804 PHY (diff) | |
download | linux-f364dd71d92fe6722fe5d47803be974dc0c40762.tar.xz linux-f364dd71d92fe6722fe5d47803be974dc0c40762.zip |
mctp: Allow MCTP on tun devices
Allowing TUN is useful for testing, to route packets to userspace or to
tunnel between machines.
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mctp/device.c')
-rw-r--r-- | net/mctp/device.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/mctp/device.c b/net/mctp/device.c index b9f38e765f61..c34963974cc1 100644 --- a/net/mctp/device.c +++ b/net/mctp/device.c @@ -356,9 +356,12 @@ static int mctp_register(struct net_device *dev) if (rtnl_dereference(dev->mctp_ptr)) return 0; - /* only register specific types; MCTP-specific and loopback for now */ - if (dev->type != ARPHRD_MCTP && dev->type != ARPHRD_LOOPBACK) + /* only register specific types (inc. NONE for TUN devices) */ + if (!(dev->type == ARPHRD_MCTP || + dev->type == ARPHRD_LOOPBACK || + dev->type == ARPHRD_NONE)) { return 0; + } mdev = mctp_add_dev(dev); if (IS_ERR(mdev)) |