Skip to content

Commit

Permalink
Merge pull request #650 from tomc797/feature/set_tun_name
Browse files Browse the repository at this point in the history
Allocate tun network device with name "ziti0"
  • Loading branch information
scareything committed May 24, 2023
2 parents d67faef + 02c9f3f commit 065f12a
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 @@ -396,11 +396,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 065f12a

Please sign in to comment.