mirror of https://github.com/ipxe/ipxe.git
Straightforward A record resolution now known working.
parent
3b59bf559c
commit
138c987738
|
@ -147,7 +147,7 @@ static inline const char * dns_skip_name ( const char *name ) {
|
||||||
*/
|
*/
|
||||||
static struct dns_rr_info * dns_find_rr ( struct dns_query *query,
|
static struct dns_rr_info * dns_find_rr ( struct dns_query *query,
|
||||||
struct dns_header *reply ) {
|
struct dns_header *reply ) {
|
||||||
int i;
|
int i, cmp;
|
||||||
const char *p = ( ( char * ) reply ) + sizeof ( struct dns_header );
|
const char *p = ( ( char * ) reply ) + sizeof ( struct dns_header );
|
||||||
|
|
||||||
/* Skip over the questions section */
|
/* Skip over the questions section */
|
||||||
|
@ -157,10 +157,10 @@ static struct dns_rr_info * dns_find_rr ( struct dns_query *query,
|
||||||
|
|
||||||
/* Process the answers section */
|
/* Process the answers section */
|
||||||
for ( i = ntohs ( reply->ancount ) ; i > 0 ; i-- ) {
|
for ( i = ntohs ( reply->ancount ) ; i > 0 ; i-- ) {
|
||||||
if ( dns_name_cmp ( query->payload, p, reply ) == 0 ) {
|
cmp = dns_name_cmp ( query->payload, p, reply );
|
||||||
return ( ( struct dns_rr_info * ) p );
|
|
||||||
}
|
|
||||||
p = dns_skip_name ( p );
|
p = dns_skip_name ( p );
|
||||||
|
if ( cmp == 0 )
|
||||||
|
return ( ( struct dns_rr_info * ) p );
|
||||||
p += ( sizeof ( struct dns_rr_info ) +
|
p += ( sizeof ( struct dns_rr_info ) +
|
||||||
ntohs ( ( ( struct dns_rr_info * ) p )->rdlength ) );
|
ntohs ( ( ( struct dns_rr_info * ) p )->rdlength ) );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue