Added CMC to I and S packet types

This commit is contained in:
Erik Ekman
2009-06-12 05:44:34 +00:00
committed by Erik Ekman
parent 3eef144fce
commit 950c0870b2
3 changed files with 15 additions and 3 deletions

View File

@@ -476,9 +476,14 @@ send_version(int fd, uint32_t version)
static void
send_ip_request(int fd, int userid)
{
char buf[512] = "I_.";
char buf[512] = "I____.";
buf[1] = b32_5to8(userid);
buf[2] = b32_5to8((rand_seed >> 10) & 0x1f);
buf[3] = b32_5to8((rand_seed >> 5) & 0x1f);
buf[4] = b32_5to8((rand_seed ) & 0x1f);
rand_seed++;
strncat(buf, topdomain, 512 - strlen(buf));
send_query(fd, buf);
}
@@ -498,10 +503,15 @@ send_case_check(int fd)
static void
send_codec_switch(int fd, int userid, int bits)
{
char buf[512] = "S__.";
char buf[512] = "S_____.";
buf[1] = b32_5to8(userid);
buf[2] = b32_5to8(bits);
buf[3] = b32_5to8((rand_seed >> 10) & 0x1f);
buf[4] = b32_5to8((rand_seed >> 5) & 0x1f);
buf[5] = b32_5to8((rand_seed ) & 0x1f);
rand_seed++;
strncat(buf, topdomain, 512 - strlen(buf));
send_query(fd, buf);
}

View File

@@ -425,7 +425,7 @@ handle_null_request(int tun_fd, int dns_fd, struct query *q, int domain_len)
} else if(in[0] == 'S' || in[0] == 's') {
int codec;
struct encoder *enc;
if (domain_len != 4) { /* len = 4, example: "S15." */
if (domain_len < 3) { /* len at least 3, example: "S15" */
write_dns(dns_fd, q, "BADLEN", 6);
return;
}