diff --git a/src/client.c b/src/client.c index efb0f51..0e1674f 100644 --- a/src/client.c +++ b/src/client.c @@ -1387,7 +1387,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); @@ -1403,11 +1403,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 75979d9..8e579bf 100644 --- a/src/iodined.c +++ b/src/iodined.c @@ -748,7 +748,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; @@ -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)); } } 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 1561b9e..69f1143 100644 --- a/src/version.h +++ b/src/version.h @@ -19,7 +19,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_ */