summaryrefslogtreecommitdiffhomepage
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
commit10cff9459c1fc863f4961341eaf5aca772948c43 (patch)
tree8307d86e33b5d14e76e249ac05a4d799dcf72219
parente08d20cdd88dbe404879ae87f87a87fece7d04bf (diff)
device: let udev know what kind of device we are
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-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);