From bc76b588c91c7d61d9909162439ec946d141b5c6 Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Sat, 12 Jul 2008 11:45:22 +0000 Subject: [PATCH] Applied patch for not configuring the tun interface, debian bug 477692 --- man/iodine.8 | 6 +++++- src/iodined.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/man/iodine.8 b/man/iodine.8 index 1289191..ac7a9eb 100644 --- a/man/iodine.8 +++ b/man/iodine.8 @@ -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 diff --git a/src/iodined.c b/src/iodined.c index 7f8cb77..b5d508c 100644 --- a/src/iodined.c +++ b/src/iodined.c @@ -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;