1
0
mirror of https://github.com/yarrick/iodine.git synced 2024-11-30 00:46:05 +03:00

prep for autotools: autoconf defines VERSION so s/VERSION/PROTOCOL_VERSION/

This commit is contained in:
Barak A. Pearlmutter 2014-04-24 15:03:47 +01:00
parent f68f7cfc25
commit 5cb67a4ab4
3 changed files with 7 additions and 6 deletions

View File

@ -1387,7 +1387,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);
@ -1403,11 +1403,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);

View File

@ -748,7 +748,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;
@ -809,7 +809,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);
} }

View File

@ -19,7 +19,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_ */