Applied patch for not configuring the tun interface, debian bug 477692

This commit is contained in:
Vincent Bernat 2008-07-12 11:45:22 +00:00 committed by Erik Ekman
parent 791c3de84c
commit a36ce9eaaf
2 changed files with 14 additions and 4 deletions

View File

@ -25,7 +25,7 @@ iodine, iodined \- tunnel IPv4 over DNS
.B iodined [-h]
.B iodined [-f] [-u
.B iodined [-f] [-s] [-u
.I user
.B ] [-P
.I password
@ -62,6 +62,10 @@ Print usage info and exit.
.B -f
Keep running in foreground.
.TP
.B -s
Don't try to configure IP address or MTU. This should only be used if
you have already configured the device that will be used.
.TP
.B -u user
Drop privileges and run as user 'user' after setting up tunnel.
.TP

View File

@ -448,6 +448,7 @@ main(int argc, char **argv)
int choice;
int port;
int mtu;
int skipipconfig;
username = NULL;
newroot = NULL;
@ -456,17 +457,21 @@ main(int argc, char **argv)
mtu = 1024;
listen_ip = INADDR_ANY;
port = 53;
skipipconfig = 0;
b32 = get_base32_encoder();
memset(password, 0, sizeof(password));
srand(time(NULL));
while ((choice = getopt(argc, argv, "vfhu:t:d:m:l:p:P:")) != -1) {
while ((choice = getopt(argc, argv, "vsfhu:t:d:m:l:p:P:")) != -1) {
switch(choice) {
case 'v':
version();
break;
case 's':
skipipconfig = 1;
break;
case 'f':
foreground = 1;
break;
@ -558,8 +563,9 @@ main(int argc, char **argv)
if ((tun_fd = open_tun(device)) == -1)
goto cleanup0;
if (tun_setip(argv[0]) != 0 || tun_setmtu(mtu) != 0)
goto cleanup1;
if (!skipipconfig)
if (tun_setip(argv[0]) != 0 || tun_setmtu(mtu) != 0)
goto cleanup1;
if ((dnsd_fd = open_dns(port, listen_ip)) == -1)
goto cleanup2;