From ab89bdcbc11ebc8d28913d3e8397c42f8b735198 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 29 Jan 2018 21:18:08 +0100 Subject: device: let udev know what kind of device we are --- src/device.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/device.c b/src/device.c index f47c126..1614d61 100644 --- a/src/device.c +++ b/src/device.c @@ -235,6 +235,10 @@ static void destruct(struct net_device *dev) free_netdev(dev); } +static const struct device_type device_type = { + .name = KBUILD_MODNAME +}; + static void setup(struct net_device *dev) { struct wireguard_device *wg = netdev_priv(dev); @@ -258,6 +262,8 @@ static void setup(struct net_device *dev) dev->hw_enc_features |= WG_NETDEV_FEATURES; dev->mtu = ETH_DATA_LEN - MESSAGE_MINIMUM_LENGTH - sizeof(struct udphdr) - max(sizeof(struct ipv6hdr), sizeof(struct iphdr)); + SET_NETDEV_DEVTYPE(dev, &device_type); + /* We need to keep the dst around in case of icmp replies. */ netif_keep_dst(dev); -- cgit v1.2.3-59-g8ed1b