diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-01-29 21:18:08 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-01-30 14:46:34 +0100 |
commit | ab89bdcbc11ebc8d28913d3e8397c42f8b735198 (patch) | |
tree | cb19976c02b9bd0eaff3d6f6d3c3f6ebe811efc5 /src/device.c | |
parent | qemu: disable AVX-512 in userland (diff) | |
download | wireguard-monolithic-historical-ab89bdcbc11ebc8d28913d3e8397c42f8b735198.tar.xz wireguard-monolithic-historical-ab89bdcbc11ebc8d28913d3e8397c42f8b735198.zip |
device: let udev know what kind of device we are
Diffstat (limited to '')
-rw-r--r-- | src/device.c | 6 |
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); |