mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-23 10:05:08 +00:00
Rename VERSION define
prep for autotools: autoconf defines VERSION so s/VERSION/PROTOCOL_VERSION/
This commit is contained in:
parent
b9a1f14e86
commit
46532539c2
@ -1395,7 +1395,7 @@ handshake_version(int dns_fd, int *seed)
|
|||||||
|
|
||||||
for (i = 0; running && i < 5; i++) {
|
for (i = 0; running && i < 5; i++) {
|
||||||
|
|
||||||
send_version(dns_fd, VERSION);
|
send_version(dns_fd, PROTOCOL_VERSION);
|
||||||
|
|
||||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 'v', 'V', i+1);
|
read = handshake_waitdns(dns_fd, in, sizeof(in), 'v', 'V', i+1);
|
||||||
|
|
||||||
@ -1411,11 +1411,12 @@ handshake_version(int dns_fd, int *seed)
|
|||||||
userid_char = hex[userid & 15];
|
userid_char = hex[userid & 15];
|
||||||
userid_char2 = hex2[userid & 15];
|
userid_char2 = hex2[userid & 15];
|
||||||
|
|
||||||
fprintf(stderr, "Version ok, both using protocol v 0x%08x. You are user #%d\n", VERSION, userid);
|
fprintf(stderr, "Version ok, both using protocol v 0x%08x. You are user #%d\n",
|
||||||
|
PROTOCOL_VERSION, userid);
|
||||||
return 0;
|
return 0;
|
||||||
} else if (strncmp("VNAK", in, 4) == 0) {
|
} else if (strncmp("VNAK", in, 4) == 0) {
|
||||||
warnx("You use protocol v 0x%08x, server uses v 0x%08x. Giving up",
|
warnx("You use protocol v 0x%08x, server uses v 0x%08x. Giving up",
|
||||||
VERSION, payload);
|
PROTOCOL_VERSION, payload);
|
||||||
return 1;
|
return 1;
|
||||||
} else if (strncmp("VFUL", in, 4) == 0) {
|
} else if (strncmp("VFUL", in, 4) == 0) {
|
||||||
warnx("Server full, all %d slots are taken. Try again later", payload);
|
warnx("Server full, all %d slots are taken. Try again later", payload);
|
||||||
|
@ -765,7 +765,7 @@ handle_null_request(int tun_fd, int dns_fd, struct query *q, int domain_len)
|
|||||||
((unpacked[3] & 0xff)));
|
((unpacked[3] & 0xff)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version == VERSION) {
|
if (version == PROTOCOL_VERSION) {
|
||||||
userid = find_available_user();
|
userid = find_available_user();
|
||||||
if (userid >= 0) {
|
if (userid >= 0) {
|
||||||
int i;
|
int i;
|
||||||
@ -826,7 +826,7 @@ handle_null_request(int tun_fd, int dns_fd, struct query *q, int domain_len)
|
|||||||
format_addr(&q->from, q->fromlen));
|
format_addr(&q->from, q->fromlen));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
send_version_response(dns_fd, VERSION_NACK, VERSION, 0, q);
|
send_version_response(dns_fd, VERSION_NACK, PROTOCOL_VERSION, 0, q);
|
||||||
syslog(LOG_INFO, "dropped user from %s, sent bad version %08X",
|
syslog(LOG_INFO, "dropped user from %s, sent bad version %08X",
|
||||||
format_addr(&q->from, q->fromlen), version);
|
format_addr(&q->from, q->fromlen), version);
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
/* This is the version of the network protocol
|
/* This is the version of the network protocol
|
||||||
It is usually equal to the latest iodine version number */
|
It is usually equal to the latest iodine version number */
|
||||||
#define VERSION 0x00000502
|
#define PROTOCOL_VERSION 0x00000502
|
||||||
|
|
||||||
#endif /* _VERSION_H_ */
|
#endif /* _VERSION_H_ */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user