diff --git a/src/client.c b/src/client.c index 0f951ac..c6236f6 100644 --- a/src/client.c +++ b/src/client.c @@ -1395,7 +1395,7 @@ handshake_version(int dns_fd, int *seed) 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); @@ -1411,11 +1411,12 @@ handshake_version(int dns_fd, int *seed) userid_char = hex[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; } else if (strncmp("VNAK", in, 4) == 0) { warnx("You use protocol v 0x%08x, server uses v 0x%08x. Giving up", - VERSION, payload); + PROTOCOL_VERSION, payload); return 1; } else if (strncmp("VFUL", in, 4) == 0) { warnx("Server full, all %d slots are taken. Try again later", payload); diff --git a/src/iodined.c b/src/iodined.c index cdfc920..82a82eb 100644 --- a/src/iodined.c +++ b/src/iodined.c @@ -765,7 +765,7 @@ handle_null_request(int tun_fd, int dns_fd, struct query *q, int domain_len) ((unpacked[3] & 0xff))); } - if (version == VERSION) { + if (version == PROTOCOL_VERSION) { userid = find_available_user(); if (userid >= 0) { 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)); } } 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", format_addr(&q->from, q->fromlen), version); } diff --git a/src/version.h b/src/version.h index 2ab00ff..67b7c42 100644 --- a/src/version.h +++ b/src/version.h @@ -20,7 +20,7 @@ /* This is the version of the network protocol It is usually equal to the latest iodine version number */ -#define VERSION 0x00000502 +#define PROTOCOL_VERSION 0x00000502 #endif /* _VERSION_H_ */