Lines 61-67
Link Here
|
61 |
"\t-t (tun mode, default)\n" |
61 |
"\t-t (tun mode, default)\n" |
62 |
"\t-T (tap mode)\n" |
62 |
"\t-T (tap mode)\n" |
63 |
#endif |
63 |
#endif |
64 |
"\t-i ip.to.bi.nd (bind to port 53 on this IP only)\n" |
64 |
"\t-i ip|interface (bind to port 53 on this IP/interface only)\n" |
65 |
"\t-C dir (chroot() to this directory after initialization)\n" |
65 |
"\t-C dir (chroot() to this directory after initialization)\n" |
66 |
"\t-D (call daemon(3) to detach from terminal)\n" |
66 |
"\t-D (call daemon(3) to detach from terminal)\n" |
67 |
"\t-g (enable debug messages)\n" |
67 |
"\t-g (enable debug messages)\n" |
Lines 80-93
Link Here
|
80 |
int daemonize = 0; |
80 |
int daemonize = 0; |
81 |
int logmask = LOG_UPTO(LOG_INFO); |
81 |
int logmask = LOG_UPTO(LOG_INFO); |
82 |
int tun = 1; |
82 |
int tun = 1; |
|
|
83 |
int r; |
83 |
|
84 |
|
84 |
while ((ch = getopt(argc, argv, "gDC:u:hd:I:i:tT")) != -1) { |
85 |
while ((ch = getopt(argc, argv, "gDC:u:hd:I:i:tT")) != -1) { |
85 |
switch(ch) { |
86 |
switch(ch) { |
86 |
case 'i': |
87 |
case 'i': |
87 |
bindto = inet_addr(optarg); |
88 |
r = addr_convert(optarg, &bindto); |
88 |
if (bindto == INADDR_NONE) { |
89 |
if (r < 0) { |
89 |
fprintf(stderr, "`%s' is not an IP-address\n", |
90 |
fprintf(stderr, "couldn't use interface %s: %s\n", optarg, |
90 |
optarg); |
91 |
strerror(-r)); |
91 |
exit(EX_USAGE); |
92 |
exit(EX_USAGE); |
92 |
} |
93 |
} |
93 |
break; |
94 |
break; |