mirror of
https://github.com/yarrick/iodine.git
synced 2025-06-08 11:43:44 +02:00
---
This commit is contained in:
parent
bcbf9cecd9
commit
64a9e55e3e
2 changed files with 105 additions and 79 deletions
|
@ -78,7 +78,9 @@ static int created_users;
|
|||
static int check_ip;
|
||||
static int my_mtu;
|
||||
static in_addr_t my_ip;
|
||||
static struct in6_addr my_ip6;
|
||||
static int netmask;
|
||||
static char netmask6;
|
||||
|
||||
static in_addr_t ns_ip;
|
||||
|
||||
|
@ -2203,6 +2205,11 @@ main(int argc, char **argv)
|
|||
char *netsize;
|
||||
int retval;
|
||||
|
||||
/**
|
||||
* Todo: fix
|
||||
*/
|
||||
char v6 = 1;
|
||||
|
||||
#ifndef WINDOWS32
|
||||
pw = NULL;
|
||||
#endif
|
||||
|
@ -2328,10 +2335,28 @@ main(int argc, char **argv)
|
|||
|
||||
my_ip = inet_addr(argv[0]);
|
||||
|
||||
/**
|
||||
* Todo: Fix ;-)
|
||||
*/
|
||||
if (v6) {
|
||||
if (inet_pton(AF_INET6, "2001:4242:4242:4242:4242:4242:4242:1", &my_ip6)
|
||||
!= 1) {
|
||||
warnx("Bad IPv6 address to use inside tunnel.");
|
||||
usage();
|
||||
}
|
||||
|
||||
printf("IPv6 address: ");
|
||||
char i;
|
||||
for (i = 0; i < 8; ++i)
|
||||
printf("%04x%s", ntohs(my_ip6.__in6_u.__u6_addr16[i]), i < 7 ? ":"
|
||||
: "\n");
|
||||
|
||||
if (my_ip == INADDR_NONE) {
|
||||
warnx("Bad IP address to use inside tunnel.");
|
||||
usage();
|
||||
}
|
||||
netmask6 = 112;
|
||||
}
|
||||
|
||||
topdomain = strdup(argv[1]);
|
||||
if (strlen(topdomain) <= 128) {
|
||||
|
|
|
@ -40,6 +40,7 @@ struct user {
|
|||
time_t last_pkt;
|
||||
int seed;
|
||||
in_addr_t tun_ip;
|
||||
struct in6_addr tun_ip6;
|
||||
struct in_addr host;
|
||||
struct query q;
|
||||
struct query q_sendrealsoon;
|
||||
|
|
Loading…
Add table
Reference in a new issue