mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-23 00:29:20 +02:00
Fix indent and device name on bsd
This commit is contained in:
parent
c46c2c99ff
commit
c7191d27e7
7
tun.c
7
tun.c
|
@ -100,8 +100,11 @@ open_tun(const char *tun_device)
|
|||
char tun_name[50];
|
||||
|
||||
if (tun_device != NULL) {
|
||||
if ((tun_fd = open(tun_device, O_RDWR)) < 0) {
|
||||
warn("open_tun: %s: %s", tun_device, strerror(errno));
|
||||
snprintf(tun_name, sizeof(tun_name), "/dev/%s", tun_device);
|
||||
strncpy(if_name, tun_device, sizeof(if_name));
|
||||
|
||||
if ((tun_fd = open(tun_name, O_RDWR)) < 0) {
|
||||
warn("open_tun: %s: %s", tun_name, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue