mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-22 21:16:07 +03:00
Fix things mentioned in #91
This commit is contained in:
parent
859b019d65
commit
3db5ccaf33
@ -2414,10 +2414,13 @@ main(int argc, char **argv)
|
|||||||
goto cleanup0;
|
goto cleanup0;
|
||||||
}
|
}
|
||||||
if (!skipipconfig) {
|
if (!skipipconfig) {
|
||||||
if (tun_setip(argv[0], users_get_first_ip(), netmask) != 0 || tun_setmtu(mtu) != 0) {
|
const char *other_ip = users_get_first_ip();
|
||||||
|
if (tun_setip(argv[0], other_ip, netmask) != 0 || tun_setmtu(mtu) != 0) {
|
||||||
retval = 1;
|
retval = 1;
|
||||||
|
free((void*) other_ip);
|
||||||
goto cleanup1;
|
goto cleanup1;
|
||||||
}
|
}
|
||||||
|
free((void*) other_ip);
|
||||||
}
|
}
|
||||||
if ((dnsd_fd = open_dns(port, listen_ip)) == -1) {
|
if ((dnsd_fd = open_dns(port, listen_ip)) == -1) {
|
||||||
retval = 1;
|
retval = 1;
|
||||||
|
@ -426,7 +426,7 @@ read_tun(int tun_fd, char *buf, size_t len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
tun_setip(const char *ip, const char *remoteip, int netbits)
|
tun_setip(const char *ip, const char *other_ip, int netbits)
|
||||||
{
|
{
|
||||||
char cmdline[512];
|
char cmdline[512];
|
||||||
int netmask;
|
int netmask;
|
||||||
@ -459,7 +459,7 @@ tun_setip(const char *ip, const char *remoteip, int netbits)
|
|||||||
if_name,
|
if_name,
|
||||||
ip,
|
ip,
|
||||||
#ifdef FREEBSD
|
#ifdef FREEBSD
|
||||||
remoteip, /* FreeBSD wants other IP as second IP */
|
other_ip, /* FreeBSD wants other IP as second IP */
|
||||||
#else
|
#else
|
||||||
ip,
|
ip,
|
||||||
#endif
|
#endif
|
||||||
|
@ -90,7 +90,7 @@ users_get_first_ip()
|
|||||||
{
|
{
|
||||||
struct in_addr ip;
|
struct in_addr ip;
|
||||||
ip.s_addr = users[0].tun_ip;
|
ip.s_addr = users[0].tun_ip;
|
||||||
return inet_ntoa(ip);
|
return strdup(inet_ntoa(ip));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
Reference in New Issue
Block a user