mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-29 16:36:03 +03:00
use htons on id
This commit is contained in:
parent
65a6847c3e
commit
f6bff7242d
6
dns.c
6
dns.c
@ -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];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user