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 [-h]
.B iodined [-f] [-u .B iodined [-f] [-s] [-u
.I user .I user
.B ] [-P .B ] [-P
.I password .I password
@ -62,6 +62,10 @@ Print usage info and exit.
.B -f .B -f
Keep running in foreground. Keep running in foreground.
.TP .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 .B -u user
Drop privileges and run as user 'user' after setting up tunnel. Drop privileges and run as user 'user' after setting up tunnel.
.TP .TP

View File

@ -448,6 +448,7 @@ main(int argc, char **argv)
int choice; int choice;
int port; int port;
int mtu; int mtu;
int skipipconfig;
username = NULL; username = NULL;
newroot = NULL; newroot = NULL;
@ -456,17 +457,21 @@ main(int argc, char **argv)
mtu = 1024; mtu = 1024;
listen_ip = INADDR_ANY; listen_ip = INADDR_ANY;
port = 53; port = 53;
skipipconfig = 0;
b32 = get_base32_encoder(); b32 = get_base32_encoder();
memset(password, 0, sizeof(password)); memset(password, 0, sizeof(password));
srand(time(NULL)); 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) { switch(choice) {
case 'v': case 'v':
version(); version();
break; break;
case 's':
skipipconfig = 1;
break;
case 'f': case 'f':
foreground = 1; foreground = 1;
break; break;
@ -558,6 +563,7 @@ main(int argc, char **argv)
if ((tun_fd = open_tun(device)) == -1) if ((tun_fd = open_tun(device)) == -1)
goto cleanup0; goto cleanup0;
if (!skipipconfig)
if (tun_setip(argv[0]) != 0 || tun_setmtu(mtu) != 0) if (tun_setip(argv[0]) != 0 || tun_setmtu(mtu) != 0)
goto cleanup1; goto cleanup1;
if ((dnsd_fd = open_dns(port, listen_ip)) == -1) if ((dnsd_fd = open_dns(port, listen_ip)) == -1)