mirror of
https://github.com/yarrick/iodine.git
synced 2025-04-10 04:21:01 +00:00
---
This commit is contained in:
parent
0f48720d63
commit
e525b7da11
1 changed files with 17 additions and 7 deletions
|
@ -922,7 +922,7 @@ handle_null_request(int tun_fd, int dns_fd, struct query *q, int domain_len)
|
||||||
return; /* illegal id */
|
return; /* illegal id */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 && memcmp(&ns_ip6, &in6addr_any, sizeof(struct in6_addr))) {
|
if (memcmp(&ns_ip6, &in6addr_any, sizeof(struct in6_addr))) {
|
||||||
/* If set, use assigned external ip (-n option) */
|
/* If set, use assigned external ip (-n option) */
|
||||||
memcpy(&replyaddr, &ns_ip6, sizeof(struct in6_addr));
|
memcpy(&replyaddr, &ns_ip6, sizeof(struct in6_addr));
|
||||||
} else {
|
} else {
|
||||||
|
@ -1561,7 +1561,7 @@ handle_ns_request(int dns_fd, struct query *q)
|
||||||
|
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
if (v6_listen) {
|
if (v6_listen) {
|
||||||
if(0 && memcmp(&ns_ip6, &in6addr_any, sizeof(struct in6_addr)))
|
if(memcmp(&ns_ip6, &in6addr_any, sizeof(struct in6_addr)))
|
||||||
memcpy(&q->destination.v6, &ns_ip6, sizeof(struct in6_addr));
|
memcpy(&q->destination.v6, &ns_ip6, sizeof(struct in6_addr));
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
@ -1599,7 +1599,7 @@ handle_a_request(int dns_fd, struct query *q, int fakeip)
|
||||||
if (v6_listen) {
|
if (v6_listen) {
|
||||||
if (fakeip)
|
if (fakeip)
|
||||||
memcpy(&q->destination.v6, &in6addr_loopback, sizeof(in_addr_t));
|
memcpy(&q->destination.v6, &in6addr_loopback, sizeof(in_addr_t));
|
||||||
else if (0 && memcmp(&ns_ip6, &in6addr_any, sizeof(struct in6_addr))) {
|
else if (memcmp(&ns_ip6, &in6addr_any, sizeof(struct in6_addr))) {
|
||||||
/* If ns_ip set, overwrite destination addr with it.
|
/* If ns_ip set, overwrite destination addr with it.
|
||||||
* Destination addr will be sent as additional record (A, IN) */
|
* Destination addr will be sent as additional record (A, IN) */
|
||||||
memcpy(&q->destination.v4.s_addr, &ns_ip6, sizeof(struct in6_addr));
|
memcpy(&q->destination.v4.s_addr, &ns_ip6, sizeof(struct in6_addr));
|
||||||
|
@ -2343,7 +2343,7 @@ usage() {
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
fprintf(stderr, "Usage: %s [-v] [-h] [-c] [-s] [-f] [-D] [-6] [-7] [-u user] "
|
fprintf(stderr, "Usage: %s [-v] [-h] [-c] [-s] [-f] [-D] [-6] [-7] [-u user] "
|
||||||
"[-t chrootdir] [-d device] [-m mtu] [-z context] "
|
"[-t chrootdir] [-d device] [-m mtu] [-z context] "
|
||||||
"[-l ip address to listen on] [-r ipv6 address to listen on] [-p port] [-n external ip] "
|
"[-l ip address to listen on] [-r ipv6 address to listen on] [-p port] [-n external ip] [-q external ip6] "
|
||||||
"[-b dnsport] [-P password] [-F pidfile] "
|
"[-b dnsport] [-P password] [-F pidfile] "
|
||||||
"tunnel_ip[/netmask] [tunnel_net6/netmask6] topdomain\n", __progname);
|
"tunnel_ip[/netmask] [tunnel_net6/netmask6] topdomain\n", __progname);
|
||||||
#else
|
#else
|
||||||
|
@ -2364,7 +2364,7 @@ help() {
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
fprintf(stderr, "Usage: %s [-v] [-h] [-c] [-s] [-f] [-D] [-6] [-7] [-u user] "
|
fprintf(stderr, "Usage: %s [-v] [-h] [-c] [-s] [-f] [-D] [-6] [-7] [-u user] "
|
||||||
"[-t chrootdir] [-d device] [-m mtu] [-z context] "
|
"[-t chrootdir] [-d device] [-m mtu] [-z context] "
|
||||||
"[-l ip address to listen on] [-r ipv6 address to listen on] [-p port] [-n external ip] [-b dnsport] [-P password] "
|
"[-l ip address to listen on] [-r ipv6 address to listen on] [-p port] [-n external ip] [-q external ip6] [-b dnsport] [-P password] "
|
||||||
"[-F pidfile] tunnel_ip[/netmask] [tunnel_net6/netmask6] topdomain\n", __progname);
|
"[-F pidfile] tunnel_ip[/netmask] [tunnel_net6/netmask6] topdomain\n", __progname);
|
||||||
#else
|
#else
|
||||||
fprintf(stderr, "Usage: %s [-v] [-h] [-c] [-s] [-f] [-D] [-u user] "
|
fprintf(stderr, "Usage: %s [-v] [-h] [-c] [-s] [-f] [-D] [-u user] "
|
||||||
|
@ -2397,6 +2397,9 @@ help() {
|
||||||
#endif
|
#endif
|
||||||
fprintf(stderr, " -p port to listen on for incoming dns traffic (default 53)\n");
|
fprintf(stderr, " -p port to listen on for incoming dns traffic (default 53)\n");
|
||||||
fprintf(stderr, " -n ip to respond with to NS queries\n");
|
fprintf(stderr, " -n ip to respond with to NS queries\n");
|
||||||
|
#ifdef LINUX
|
||||||
|
fprintf(stderr, " -q ipv6 to respond with to NS queries\n");
|
||||||
|
#endif
|
||||||
fprintf(stderr, " -b port to forward normal DNS queries to (on localhost)\n");
|
fprintf(stderr, " -b port to forward normal DNS queries to (on localhost)\n");
|
||||||
fprintf(stderr, " -P password used for authentication (max 32 chars will be used)\n");
|
fprintf(stderr, " -P password used for authentication (max 32 chars will be used)\n");
|
||||||
fprintf(stderr, " -F pidfile to write pid to a file\n");
|
fprintf(stderr, " -F pidfile to write pid to a file\n");
|
||||||
|
@ -2505,7 +2508,7 @@ main(int argc, char **argv)
|
||||||
fw_query_init();
|
fw_query_init();
|
||||||
|
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
while ((choice = getopt(argc, argv, "67vcsfhDu:t:d:m:l:r:p:n:b:P:z:F:")) != -1) {
|
while ((choice = getopt(argc, argv, "67vcsfhDu:t:d:m:l:q:r:p:n:b:P:z:F:")) != -1) {
|
||||||
#else
|
#else
|
||||||
while ((choice = getopt(argc, argv, "vcsfhDu:t:d:m:l:p:n:b:P:z:F:")) != -1) {
|
while ((choice = getopt(argc, argv, "vcsfhDu:t:d:m:l:p:n:b:P:z:F:")) != -1) {
|
||||||
#endif
|
#endif
|
||||||
|
@ -2546,7 +2549,7 @@ main(int argc, char **argv)
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
case 'r':
|
case 'r':
|
||||||
if (inet_pton(AF_INET6, optarg, &listen_ip6) != 1) {
|
if (inet_pton(AF_INET6, optarg, &listen_ip6) != 1) {
|
||||||
warnx("Bad IP address to listen on.");
|
warnx("Bad IPv6 address to listen on.");
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2557,6 +2560,13 @@ main(int argc, char **argv)
|
||||||
case 'n':
|
case 'n':
|
||||||
ns_ip = inet_addr(optarg);
|
ns_ip = inet_addr(optarg);
|
||||||
break;
|
break;
|
||||||
|
#ifdef LINUX
|
||||||
|
case 'q':
|
||||||
|
if (inet_pton(AF_INET6, optarg, &ns_ip6) != 1) {
|
||||||
|
warnx("Bad external IPv6 address.");
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
case 'b':
|
case 'b':
|
||||||
bind_enable = 1;
|
bind_enable = 1;
|
||||||
bind_port = atoi(optarg);
|
bind_port = atoi(optarg);
|
||||||
|
|
Loading…
Add table
Reference in a new issue