- const void *oaddr= dgram + *cbyte_io;
- int avail= max - *cbyte_io;
- int step= -1;
- void *addrp= 0;
-
- switch (rrty) {
- case adns_r_a:
- if ((pai->qu->flags & adns_qf_ipv6_mapv4) &&
- (pai->qu->answer->type & adns__qtf_bigaddr)) {
- if (avail < 4) return adns_s_invaliddata;
- memset(v6map.s6_addr + 0, 0x00, 10);
- memset(v6map.s6_addr + 10, 0xff, 2);
- memcpy(v6map.s6_addr + 12, oaddr, 4);
- oaddr= v6map.s6_addr; avail= sizeof(v6map.s6_addr);
- if (step < 0) step= 4;
- goto aaaa;
- }
- af= AF_INET; addrlen= 4;
- addrp= &storeto->addr.inet.sin_addr;
- salen= sizeof(storeto->addr.inet);
- break;
- case adns_r_aaaa:
- aaaa:
- af= AF_INET6; addrlen= 16;
- addrp= storeto->addr.inet6.sin6_addr.s6_addr;
- salen= sizeof(storeto->addr.inet6);
- break;
+
+ const void *use_addr= pai->dgram + *cbyte_io;
+
+ switch (in_rrty) {
+ case adns_r_a: in_addrlen= 4; out_af= AF_INET; break;
+ case adns_r_aaaa: in_addrlen= 16; out_af= AF_INET6; break;
+ default: abort();