; this should be the normal thing for client-serving DNS servers.)
;
+%include "macros.inc"
+%include "pxe.inc"
+
DNS_PORT equ htons(53) ; Default DNS port
DNS_MAX_PACKET equ 512 ; Defined by protocol
; TFTP uses the range 49152-57343; avoid that range
stosw ; QCLASS = 1 = IN
sub di,DNSSendBuf
- mov [pxe_udp_write_pkt_dns.bufsize],di
+ mov [pxe_udp_write_pkt_dns.buffersize],di
; Now, send it to the nameserver(s)
; Outer loop: exponential backoff
mov eax,[di]
- mov [pxe_udp_write_pkt_dns.status],0
+ mov word [pxe_udp_write_pkt_dns.status],0
mov [pxe_udp_write_pkt_dns.sip],eax
mov [pxe_udp_read_pkt_dns.sip],eax
mov di,pxe_udp_write_pkt_dns
mov bx,PXENV_UDP_WRITE
call pxenv
- jc .failure
- cmp word [pxe_udp_write_pkt.status],0
- jne .failure
+ jc .timeout ; Treat failed transmit as timeout
+ cmp word [pxe_udp_write_pkt_dns.status],0
+ jne .timeout
mov cx,[BIOS_timer]
.waitrecv:
cmp ax,dx
jae .timeout
- mov [pxe_udp_read_pkt_dns.status],0
+ mov word [pxe_udp_read_pkt_dns.status],0
+ mov word [pxe_udp_read_pkt_dns.buffersize],DNS_MAX_PACKET
mov di,pxe_udp_read_pkt_dns
mov bx,PXENV_UDP_READ
call pxenv