This commit is contained in:
Julian Kranz 2012-01-01 16:00:34 +01:00 committed by Barak A. Pearlmutter
parent bcbf9cecd9
commit 64a9e55e3e
2 changed files with 105 additions and 79 deletions

View file

@ -78,7 +78,9 @@ static int created_users;
static int check_ip; static int check_ip;
static int my_mtu; static int my_mtu;
static in_addr_t my_ip; static in_addr_t my_ip;
static struct in6_addr my_ip6;
static int netmask; static int netmask;
static char netmask6;
static in_addr_t ns_ip; static in_addr_t ns_ip;
@ -2203,6 +2205,11 @@ main(int argc, char **argv)
char *netsize; char *netsize;
int retval; int retval;
/**
* Todo: fix
*/
char v6 = 1;
#ifndef WINDOWS32 #ifndef WINDOWS32
pw = NULL; pw = NULL;
#endif #endif
@ -2328,10 +2335,28 @@ main(int argc, char **argv)
my_ip = inet_addr(argv[0]); 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) { if (my_ip == INADDR_NONE) {
warnx("Bad IP address to use inside tunnel."); warnx("Bad IP address to use inside tunnel.");
usage(); usage();
} }
netmask6 = 112;
}
topdomain = strdup(argv[1]); topdomain = strdup(argv[1]);
if (strlen(topdomain) <= 128) { if (strlen(topdomain) <= 128) {

View file

@ -40,6 +40,7 @@ struct user {
time_t last_pkt; time_t last_pkt;
int seed; int seed;
in_addr_t tun_ip; in_addr_t tun_ip;
struct in6_addr tun_ip6;
struct in_addr host; struct in_addr host;
struct query q; struct query q;
struct query q_sendrealsoon; struct query q_sendrealsoon;