use htons on id

This commit is contained in:
Erik Ekman 2006-06-06 02:42:29 +00:00
parent 65a6847c3e
commit f6bff7242d
2 changed files with 4 additions and 4 deletions

6
dns.c
View file

@ -185,7 +185,7 @@ dns_ping(int dns_fd)
printf("No reply on chunk, resending\n"); printf("No reply on chunk, resending\n");
dns_send_chunk(dns_fd); dns_send_chunk(dns_fd);
} else { } else {
dns_write(dns_fd, chunkid++, "", 0); dns_write(dns_fd, 0, "", 0);
} }
} }
@ -203,7 +203,7 @@ dns_query(int fd, int id, char *host, int type)
header = (HEADER*)buf; header = (HEADER*)buf;
header->id = id; header->id = htons(id);
header->qr = 0; header->qr = 0;
header->opcode = 0; header->opcode = 0;
header->aa = 0; header->aa = 0;
@ -297,7 +297,7 @@ dns_read(int fd, char *buf, int buflen)
short ancount; short ancount;
char *data; char *data;
char name[255]; char name[255];
char rdata[256]; char rdata[4*1024];
HEADER *header; HEADER *header;
char packet[64*1024]; char packet[64*1024];

View file

@ -58,7 +58,7 @@ tunnel(int tun_fd, int dns_fd)
while (running) { while (running) {
if (fastpoll) { if (fastpoll) {
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_usec = 5000; tv.tv_usec = 55000;
fastpoll = 0; fastpoll = 0;
printf("Fast poll\n"); printf("Fast poll\n");
} else { } else {