mirror of
https://github.com/yarrick/iodine.git
synced 2025-04-11 21:10:56 +00:00
---
This commit is contained in:
parent
9fa399adcc
commit
1f1466c194
2 changed files with 20 additions and 14 deletions
|
@ -179,7 +179,7 @@ main(int argc, char **argv)
|
||||||
__progname++;
|
__progname++;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while ((choice = getopt(argc, argv, "vfhru6:t:d:R:P:m:M:F:T:O:L:I:")) != -1) {
|
while ((choice = getopt(argc, argv, "6vfhru:t:d:R:P:m:M:F:T:O:L:I:")) != -1) {
|
||||||
switch(choice) {
|
switch(choice) {
|
||||||
case 'v':
|
case 'v':
|
||||||
version();
|
version();
|
||||||
|
|
|
@ -88,6 +88,8 @@ static in_addr_t ns_ip;
|
||||||
static int bind_port;
|
static int bind_port;
|
||||||
static int debug;
|
static int debug;
|
||||||
|
|
||||||
|
static char v6;
|
||||||
|
|
||||||
#if !defined(BSD) && !defined(__GLIBC__)
|
#if !defined(BSD) && !defined(__GLIBC__)
|
||||||
static char *__progname;
|
static char *__progname;
|
||||||
#endif
|
#endif
|
||||||
|
@ -801,21 +803,27 @@ handle_null_request(int tun_fd, int dns_fd, struct query *q, int domain_len)
|
||||||
tempip.s_addr = users[userid].tun_ip;
|
tempip.s_addr = users[userid].tun_ip;
|
||||||
tmp[1] = strdup(inet_ntoa(tempip));
|
tmp[1] = strdup(inet_ntoa(tempip));
|
||||||
|
|
||||||
struct in6_addr ip6;
|
if (v6) {
|
||||||
|
struct in6_addr ip6;
|
||||||
|
|
||||||
memcpy(&ip6, &my_net6, sizeof(my_net6));
|
memcpy(&ip6, &my_net6, sizeof(my_net6));
|
||||||
ipv6_addr_add(&ip6, 1);
|
ipv6_addr_add(&ip6, 1);
|
||||||
char server6[41];
|
char server6[41];
|
||||||
inet_ntop(AF_INET6, &ip6, server6, sizeof(server6));
|
inet_ntop(AF_INET6, &ip6, server6, sizeof(server6));
|
||||||
|
|
||||||
memcpy(&ip6, &(users[userid].tun_ip6), sizeof(my_net6));
|
memcpy(&ip6, &(users[userid].tun_ip6), sizeof(my_net6));
|
||||||
char client6[41];
|
char client6[41];
|
||||||
inet_ntop(AF_INET6, &ip6, client6, sizeof(client6));
|
inet_ntop(AF_INET6, &ip6, client6, sizeof(client6));
|
||||||
|
|
||||||
read = snprintf(out, sizeof(out), "%s-%s-%d-%d-%s-%s-%d",
|
read = snprintf(out, sizeof(out), "%s-%s-%d-%d-%s-%s-%d",
|
||||||
tmp[0], tmp[1], my_mtu, netmask, server6, client6, netmask6);
|
tmp[0], tmp[1], my_mtu, netmask, server6, client6,
|
||||||
|
netmask6);
|
||||||
|
}
|
||||||
|
|
||||||
printf("%s\n", out);
|
read = snprintf(out, sizeof(out), "%s-%s-%d-%d",
|
||||||
|
tmp[0], tmp[1], my_mtu, netmask);
|
||||||
|
|
||||||
|
//printf("%s\n", out);
|
||||||
|
|
||||||
write_dns(dns_fd, q, out, read, users[userid].downenc);
|
write_dns(dns_fd, q, out, read, users[userid].downenc);
|
||||||
q->id = 0;
|
q->id = 0;
|
||||||
|
@ -2246,8 +2254,6 @@ main(int argc, char **argv)
|
||||||
char *netsize;
|
char *netsize;
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
char v6;
|
|
||||||
|
|
||||||
#ifndef WINDOWS32
|
#ifndef WINDOWS32
|
||||||
pw = NULL;
|
pw = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue