aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/device.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-01-29 21:18:08 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-01-30 14:46:34 +0100
commitab89bdcbc11ebc8d28913d3e8397c42f8b735198 (patch)
treecb19976c02b9bd0eaff3d6f6d3c3f6ebe811efc5 /src/device.c
parentqemu: disable AVX-512 in userland (diff)
downloadwireguard-monolithic-historical-ab89bdcbc11ebc8d28913d3e8397c42f8b735198.tar.xz
wireguard-monolithic-historical-ab89bdcbc11ebc8d28913d3e8397c42f8b735198.zip
device: let udev know what kind of device we are
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c6
1 files changed, 6 insertions, 0 deletions
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);