fail when a tun device has no name

This commit is contained in:
Nikos Mavrogiannopoulos
2014-09-19 21:29:30 +02:00
parent d5d27b2379
commit 552e7b24e7

View File

@@ -417,6 +417,11 @@ int open_tun(main_server_st * s, struct proc_st *proc)
set_cloexec_flag(tunfd, 1); set_cloexec_flag(tunfd, 1);
#endif #endif
if (proc->tun_lease.name[0] == 0) {
mslog(s, NULL, LOG_ERR, "tun device with no name!");
goto fail;
}
/* set IP/mask */ /* set IP/mask */
ret = set_network_info(s, proc); ret = set_network_info(s, proc);
if (ret < 0) { if (ret < 0) {