mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-24 19:40:28 +00:00
Make ANSI mode closer to being ANSI
This commit is contained in:
parent
28135b7a20
commit
46085797b6
23 changed files with 352 additions and 92 deletions
|
@ -52,12 +52,12 @@ int serializednsheader(uint8_t *buf, size_t size,
|
|||
int deserializednsheader(struct DnsHeader *header, const uint8_t *buf,
|
||||
size_t size) {
|
||||
if (size < 12) return ebadmsg();
|
||||
header->id = read16be(buf + 0);
|
||||
header->id = READ16BE(buf + 0);
|
||||
header->bf1 = buf[2];
|
||||
header->bf2 = buf[3];
|
||||
header->qdcount = read16be(buf + 4);
|
||||
header->ancount = read16be(buf + 6);
|
||||
header->nscount = read16be(buf + 8);
|
||||
header->arcount = read16be(buf + 10);
|
||||
header->qdcount = READ16BE(buf + 4);
|
||||
header->ancount = READ16BE(buf + 6);
|
||||
header->nscount = READ16BE(buf + 8);
|
||||
header->arcount = READ16BE(buf + 10);
|
||||
return 12;
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ int resolvedns(const struct ResolvConf *resolvconf, int af, const char *name,
|
|||
rtype = READ16BE(p), p += 2;
|
||||
rclass = READ16BE(p), p += 2;
|
||||
/* ttl */ p += 4;
|
||||
rdlength = read16be(p), p += 2;
|
||||
rdlength = READ16BE(p), p += 2;
|
||||
if (p + rdlength <= pe && rdlength == 4 &&
|
||||
(rtype == DNS_TYPE_A && rclass == DNS_CLASS_IN)) {
|
||||
res = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue