Skip to content

Commit

Permalink
Set tun ifname to "ziti%d"
Browse files Browse the repository at this point in the history
Distinguish the tun ifname from other tun devices.

Signed-off-by: Tom Carroll <[email protected]>
  • Loading branch information
tomc797 committed May 14, 2023
1 parent 37f07c0 commit 02c9f3f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions programs/ziti-edge-tunnel/netif_driver/linux/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,10 @@ netif_driver tun_open(uv_loop_t *loop, uint32_t tun_ip, uint32_t dns_ip, const c
return NULL;
}

struct ifreq ifr;
memset(&ifr, 0, sizeof(ifr));
ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
struct ifreq ifr = { .ifr_name = "ziti%d",
.ifr_flags = IFF_TUN | IFF_NO_PI };

if (ioctl(tun->fd, TUNSETIFF, (void *) &ifr) < 0) {
if (ioctl(tun->fd, TUNSETIFF, &ifr) < 0) {
if (error != NULL) {
snprintf(error, error_len, "failed to open tun device:%s", strerror(errno));
}
Expand Down

0 comments on commit 02c9f3f

Please sign in to comment.