mirror of
https://github.com/yarrick/iodine.git
synced 2025-04-10 04:21:01 +00:00
---
This commit is contained in:
parent
aa087e1ce4
commit
854465e62a
3 changed files with 19 additions and 14 deletions
|
@ -380,7 +380,9 @@ send_query(int fd, char *hostname)
|
||||||
chunkid_prev = chunkid;
|
chunkid_prev = chunkid;
|
||||||
chunkid += 7727;
|
chunkid += 7727;
|
||||||
if (chunkid == 0)
|
if (chunkid == 0)
|
||||||
/* 0 is used as "no-query" in iodined.c */
|
/* 0 is used as "no-query" in iodined static char a = 0;
|
||||||
|
printf("send_query() -> sendto: %d\n", a);
|
||||||
|
a++;.c */
|
||||||
chunkid = 7727;
|
chunkid = 7727;
|
||||||
|
|
||||||
q.id = chunkid;
|
q.id = chunkid;
|
||||||
|
@ -396,10 +398,6 @@ send_query(int fd, char *hostname)
|
||||||
fprintf(stderr, " Sendquery: id %5d name[0] '%c'\n", q.id, hostname[0]);
|
fprintf(stderr, " Sendquery: id %5d name[0] '%c'\n", q.id, hostname[0]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char a = 0;
|
|
||||||
printf("send_query() -> sendto: %d\n", a);
|
|
||||||
a++;
|
|
||||||
|
|
||||||
if(_v6_connect)
|
if(_v6_connect)
|
||||||
sendto(fd, packet, len, 0, (struct sockaddr*)&nameserv6, sizeof(nameserv6));
|
sendto(fd, packet, len, 0, (struct sockaddr*)&nameserv6, sizeof(nameserv6));
|
||||||
else
|
else
|
||||||
|
|
|
@ -154,14 +154,18 @@ check_user_and_ip(int userid, struct query *q)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#ifdef LINUX
|
||||||
* Todo: IPv6
|
if (v6_listen) {
|
||||||
*/
|
return memcmp(&(users[userid].host.v6), &q->from.v6,
|
||||||
|
sizeof(struct in6_addr));
|
||||||
return 0;
|
} else {
|
||||||
|
#endif
|
||||||
tempin = (struct sockaddr_in *) &(q->from);
|
tempin = (struct sockaddr_in *) &(q->from);
|
||||||
return memcmp(&(users[userid].host), &(tempin->sin_addr), sizeof(struct in_addr));
|
return memcmp(&(users[userid].host), &(tempin->sin_addr),
|
||||||
|
sizeof(struct in_addr));
|
||||||
|
#ifdef LINUX
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -44,7 +44,10 @@ struct user {
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
struct in6_addr tun_ip6;
|
struct in6_addr tun_ip6;
|
||||||
#endif
|
#endif
|
||||||
struct in_addr host;
|
union {
|
||||||
|
struct in_addr v4;
|
||||||
|
struct in6_addr v6;
|
||||||
|
} host;
|
||||||
struct query q;
|
struct query q;
|
||||||
struct query q_sendrealsoon;
|
struct query q_sendrealsoon;
|
||||||
int q_sendrealsoon_new;
|
int q_sendrealsoon_new;
|
||||||
|
|
Loading…
Add table
Reference in a new issue