From 96e4fc040f9ae92f1a5b637384bbe2f60be648f5 Mon Sep 17 00:00:00 2001 From: Koichiro IWAO Date: Thu, 1 Jun 2023 15:10:42 +0900 Subject: [PATCH] Cedar/VLanUnix: add description to FreeBSD tap device $ ifconfig vpn_client vpn_client: flags=8843 metric 0 mtu 1500 description: SoftEther Virtual Network Adapter options=80000 ether 5e:51:5e:48:ea:ef hwaddr 58:9c:fc:10:34:2a groups: tap media: Ethernet autoselect status: active nd6 options=29 Opened by PID 35981 --- src/Cedar/VLanUnix.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Cedar/VLanUnix.c b/src/Cedar/VLanUnix.c index 01d09d64..633c4fd9 100644 --- a/src/Cedar/VLanUnix.c +++ b/src/Cedar/VLanUnix.c @@ -470,6 +470,17 @@ int UnixCreateTapDeviceEx(char *name, char *prefix, UCHAR *mac_address, bool cre ioctl(s, SIOCSIFLLADDR, &ifr); } + // Set interface description +#ifdef SIOCSIFDESCR + { + char desc[] = CEDAR_PRODUCT_STR " Virtual Network Adapter"; + + ifr.ifr_buffer.buffer = desc; + ifr.ifr_buffer.length = StrLen(desc) + 1; + ioctl(s, SIOCSIFDESCR, &ifr); + } +#endif + if (create_up) { Zero(&ifr, sizeof(ifr));