@@ -365,10 +365,10 @@ static void dns_tell(int indent, dns_t *dp, size_t size)
365365 if (dp -> hdr .cd ) printf (" CD" );
366366 fputc ('\n' , stdout );
367367
368- count [0 ]= ntohs (dp -> hdr .dh_qdcount );
369- count [1 ]= ntohs (dp -> hdr .dh_ancount );
370- count [2 ]= ntohs (dp -> hdr .dh_nscount );
371- count [3 ]= ntohs (dp -> hdr .dh_arcount );
368+ count [0 ]= ntohs (dp -> hdr .qdcount );
369+ count [1 ]= ntohs (dp -> hdr .ancount );
370+ count [2 ]= ntohs (dp -> hdr .nscount );
371+ count [3 ]= ntohs (dp -> hdr .arcount );
372372 cp = dp -> data ;
373373 for (i = 0 ; i < 4 ; i ++ ) {
374374 while (count [i ] > 0 ) {
@@ -402,10 +402,10 @@ static u32_t dns_ttl(dns_t *dp, size_t size, u32_t delta)
402402 if (size < sizeof (HEADER )) return 0 ;
403403
404404 rcode = dp -> hdr .rcode ;
405- count [0 ]= ntohs (dp -> hdr .dh_qdcount );
406- count [1 ]= ntohs (dp -> hdr .dh_ancount );
407- count [2 ]= ntohs (dp -> hdr .dh_nscount );
408- count [3 ]= ntohs (dp -> hdr .dh_arcount );
405+ count [0 ]= ntohs (dp -> hdr .qdcount );
406+ count [1 ]= ntohs (dp -> hdr .ancount );
407+ count [2 ]= ntohs (dp -> hdr .nscount );
408+ count [3 ]= ntohs (dp -> hdr .arcount );
409409 cp = dp -> data ;
410410 for (i = 0 ; i < 4 && cp < dlim ; i ++ ) {
411411 while (count [i ] > 0 ) {
@@ -915,10 +915,10 @@ static int query_hosts(u8_t *qname, unsigned type, dns_t *dp, size_t *pdlen)
915915 dns .hdr .ad = 0 ;
916916 dns .hdr .cd = 0 ;
917917 dns .hdr .rcode = 0 ;
918- dns .hdr .dh_qdcount = HTONS (1 );
918+ dns .hdr .qdcount = HTONS (1 );
919919 ancount = 0 ;
920- dns .hdr .dh_nscount = HTONS (0 );
921- dns .hdr .dh_arcount = HTONS (0 );
920+ dns .hdr .nscount = HTONS (0 );
921+ dns .hdr .arcount = HTONS (0 );
922922
923923 dnvec [0 ]= dns2oct (& dns );
924924 dnvec [1 ]= nil ;
@@ -1036,7 +1036,7 @@ static int query_hosts(u8_t *qname, unsigned type, dns_t *dp, size_t *pdlen)
10361036
10371037 if (r == -1 || ancount == 0 ) return 0 ;
10381038
1039- dns .hdr .dh_ancount = htons (ancount );
1039+ dns .hdr .ancount = htons (ancount );
10401040 memcpy (dp , & dns , * pdlen = cp - dns2oct (& dns ));
10411041 return 1 ;
10421042}
@@ -1061,10 +1061,10 @@ static int query_chaos(u8_t *qname, unsigned type, dns_t *dp, size_t *pdlen)
10611061 dns .hdr .ad = 0 ;
10621062 dns .hdr .cd = 0 ;
10631063 dns .hdr .rcode = 0 ;
1064- dns .hdr .dh_qdcount = HTONS (1 );
1065- dns .hdr .dh_ancount = HTONS (1 );
1066- dns .hdr .dh_nscount = HTONS (0 );
1067- dns .hdr .dh_arcount = htons (n_nameds );
1064+ dns .hdr .qdcount = HTONS (1 );
1065+ dns .hdr .ancount = HTONS (1 );
1066+ dns .hdr .nscount = HTONS (0 );
1067+ dns .hdr .arcount = htons (n_nameds );
10681068
10691069 dnvec [0 ]= dns2oct (& dns );
10701070 dnvec [1 ]= nil ;
@@ -1129,7 +1129,7 @@ static void cache_reply(dns_t *dp, size_t dlen)
11291129 u32_t minttl ;
11301130
11311131 if ((dp -> hdr .rd && !dp -> hdr .tc )) return ;
1132- if (dp -> hdr .dh_qdcount != HTONS (1 )) return ;
1132+ if (dp -> hdr .qdcount != HTONS (1 )) return ;
11331133 cp = dp -> data ;
11341134 r = dn_expand (dns2oct (dp ), dns2oct (dp ) + dlen , cp , name , MAXDNAME );
11351135 if (r == -1 ) return ;
@@ -1211,7 +1211,7 @@ static int compose_reply(dns_t *dp, size_t *pdlen)
12111211 }
12121212
12131213 /* Remember ID and RD. */
1214- id = dp -> hdr .dh_id ;
1214+ id = dp -> hdr .id ;
12151215 rd = dp -> hdr .rd ;
12161216
12171217 if (r == -1 ) {
@@ -1269,7 +1269,7 @@ static int compose_reply(dns_t *dp, size_t *pdlen)
12691269 }
12701270
12711271 /* Copy ID and RD back to answer. */
1272- dp -> hdr .dh_id = id ;
1272+ dp -> hdr .id = id ;
12731273 dp -> hdr .rd = rd ;
12741274 * pdlen = dlen ;
12751275 return 1 ;
@@ -1322,7 +1322,7 @@ static void refresh_cache(void)
13221322 cp += sizeof (u16_t );
13231323 dlen = cp - dns2oct (& udp .dns );
13241324
1325- udp .dns .hdr .dh_id = new_id (ID_REFRESH , my_port , ID_IPSELF );
1325+ udp .dns .hdr .id = new_id (ID_REFRESH , my_port , ID_IPSELF );
13261326 udp .dns .hdr .qr = 0 ;
13271327 udp .dns .hdr .opcode = 0 ;
13281328 udp .dns .hdr .aa = 0 ;
@@ -1334,10 +1334,10 @@ static void refresh_cache(void)
13341334 udp .dns .hdr .ad = 0 ;
13351335 udp .dns .hdr .cd = 0 ;
13361336 udp .dns .hdr .rcode = 0 ;
1337- udp .dns .hdr .dh_qdcount = HTONS (1 );
1338- udp .dns .hdr .dh_ancount = HTONS (0 );
1339- udp .dns .hdr .dh_nscount = HTONS (0 );
1340- udp .dns .hdr .dh_arcount = HTONS (0 );
1337+ udp .dns .hdr .qdcount = HTONS (1 );
1338+ udp .dns .hdr .ancount = HTONS (0 );
1339+ udp .dns .hdr .nscount = HTONS (0 );
1340+ udp .dns .hdr .arcount = HTONS (0 );
13411341
13421342 udp .hdr .uih_dst_addr = current_named ();
13431343 udp .hdr .uih_dst_port = named_port ;
@@ -1400,7 +1400,7 @@ static int job_read_udp(void *data, int expired)
14001400 /* This is a remote named reply, not a query. */
14011401
14021402 /* Response to a query previously relayed? */
1403- if (!old_id (udp .dns .hdr .dh_id , & id , & port , & ip )) return 1 ;
1403+ if (!old_id (udp .dns .hdr .id , & id , & port , & ip )) return 1 ;
14041404
14051405 if (ip == ID_IPSELF && id == ID_PROBE ) {
14061406 if (searching ()) {
@@ -1438,13 +1438,13 @@ static int job_read_udp(void *data, int expired)
14381438 if (ip == ID_IPSELF ) return 1 ;
14391439
14401440 /* Send the reply to the process that asked for it. */
1441- udp .dns .hdr .dh_id = id ;
1441+ udp .dns .hdr .id = id ;
14421442 udp .hdr .uih_dst_addr = ip ;
14431443 udp .hdr .uih_dst_port = port ;
14441444 if (debug >= 1 ) printf ("To client %s:%u\n" , inet_ntoa (ip ), ntohs (port ));
14451445 } else {
14461446 /* A query. */
1447- if (udp .dns .hdr .dh_qdcount != HTONS (1 )) return 1 ;
1447+ if (udp .dns .hdr .qdcount != HTONS (1 )) return 1 ;
14481448
14491449 if (localonly ) {
14501450 /* Check if it's a local query. */
@@ -1471,7 +1471,7 @@ static int job_read_udp(void *data, int expired)
14711471 }
14721472 } else {
14731473 /* Let a real name daemon handle the query. */
1474- udp .dns .hdr .dh_id = new_id (udp .dns .hdr .dh_id ,
1474+ udp .dns .hdr .id = new_id (udp .dns .hdr .id ,
14751475 udp .hdr .uih_src_port , udp .hdr .uih_src_addr );
14761476 udp .hdr .uih_dst_addr = current_named ();
14771477 udp .hdr .uih_dst_port = named_port ;
@@ -1954,7 +1954,7 @@ static void named_probe(ipaddr_t ip)
19541954 /* Send a simple DNS query that all name servers can answer easily:
19551955 * "What are the name servers for the root domain?"
19561956 */
1957- udp .dns .hdr .dh_id = new_id (ID_PROBE , my_port , ID_IPSELF );
1957+ udp .dns .hdr .id = new_id (ID_PROBE , my_port , ID_IPSELF );
19581958 udp .dns .hdr .qr = 0 ;
19591959 udp .dns .hdr .opcode = 0 ;
19601960 udp .dns .hdr .aa = 0 ;
@@ -1965,10 +1965,10 @@ static void named_probe(ipaddr_t ip)
19651965 udp .dns .hdr .ad = 0 ;
19661966 udp .dns .hdr .cd = 0 ;
19671967 udp .dns .hdr .rcode = 0 ;
1968- udp .dns .hdr .dh_qdcount = HTONS (1 );
1969- udp .dns .hdr .dh_ancount = HTONS (0 );
1970- udp .dns .hdr .dh_nscount = HTONS (0 );
1971- udp .dns .hdr .dh_arcount = HTONS (0 );
1968+ udp .dns .hdr .qdcount = HTONS (1 );
1969+ udp .dns .hdr .ancount = HTONS (0 );
1970+ udp .dns .hdr .nscount = HTONS (0 );
1971+ udp .dns .hdr .arcount = HTONS (0 );
19721972
19731973 udp .dns .data [0 ] = 0 ; /* Null name. */
19741974 pack16 (udp .dns .data + 1 , HTONS (T_NS ));
0 commit comments