mirror of
https://github.com/yarrick/iodine.git
synced 2024-09-07 11:37:03 +00:00
Send EDNS part
This commit is contained in:
parent
b681e3a0d9
commit
a065151c1b
9
dns.c
9
dns.c
|
@ -215,6 +215,7 @@ dns_query(int fd, int id, char *host, int type)
|
|||
header->ra = 0;
|
||||
|
||||
header->qdcount = htons(1);
|
||||
header->arcount = htons(1);
|
||||
|
||||
p = buf + sizeof(HEADER);
|
||||
p += host2dns(host, p, strlen(host));
|
||||
|
@ -222,6 +223,14 @@ dns_query(int fd, int id, char *host, int type)
|
|||
PUTSHORT(type, p);
|
||||
PUTSHORT(C_IN, p);
|
||||
|
||||
// EDNS0
|
||||
*p++ = 0x00; //Root
|
||||
PUTSHORT(0x0029, p); // OPT
|
||||
PUTSHORT(0x1000, p); // Payload size: 4096
|
||||
PUTSHORT(0x0000, p); // Higher bits/ edns version
|
||||
PUTSHORT(0x8000, p); // Z
|
||||
PUTSHORT(0x0000, p); // Data length
|
||||
|
||||
peerlen = sizeof(peer);
|
||||
|
||||
len = p - buf;
|
||||
|
|
Loading…
Reference in a new issue