summaryrefslogtreecommitdiff
path: root/ares_parse_ns_reply.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-01-11 13:49:13 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-01-11 13:49:13 +0000
commit8362245c42883bf5775d87d2d996b89b6f2f2fed (patch)
treef1c521d433f43de18eb8614b0e7180ae9c68cf95 /ares_parse_ns_reply.c
parentbcb85d35df7e1f9144f6256d6ec5f61a93dcc86d (diff)
downloadc-ares-8362245c42883bf5775d87d2d996b89b6f2f2fed.tar.gz
c-ares-8362245c42883bf5775d87d2d996b89b6f2f2fed.tar.bz2
c-ares-8362245c42883bf5775d87d2d996b89b6f2f2fed.zip
- Phil Blundell added the internal function ares__expand_name_for_response()
that is now used by the ares_parse_*_reply() functions instead of the ares_expand_name() simply to easier return ARES_EBADRESP for the cases where the name expansion fails as in responses that really isn't expected.
Diffstat (limited to 'ares_parse_ns_reply.c')
-rw-r--r--ares_parse_ns_reply.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ares_parse_ns_reply.c b/ares_parse_ns_reply.c
index 9eed3eb..abcf883 100644
--- a/ares_parse_ns_reply.c
+++ b/ares_parse_ns_reply.c
@@ -73,7 +73,7 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
/* Expand the name from the question, and skip past the question. */
aptr = abuf + HFIXEDSZ;
- status = ares_expand_name( aptr, abuf, alen, &hostname, &len );
+ status = ares__expand_name_for_response( aptr, abuf, alen, &hostname, &len);
if ( status != ARES_SUCCESS )
return status;
if ( aptr + len + QFIXEDSZ > abuf + alen )
@@ -96,7 +96,7 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
for ( i = 0; i < ( int ) ancount; i++ )
{
/* Decode the RR up to the data field. */
- status = ares_expand_name( aptr, abuf, alen, &rr_name, &len );
+ status = ares__expand_name_for_response( aptr, abuf, alen, &rr_name, &len );
if ( status != ARES_SUCCESS )
break;
aptr += len;
@@ -113,7 +113,8 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
if ( rr_class == C_IN && rr_type == T_NS )
{
/* Decode the RR data and add it to the nameservers list */
- status = ares_expand_name( aptr, abuf, alen, &rr_data, &len );
+ status = ares__expand_name_for_response( aptr, abuf, alen, &rr_data,
+ &len);
if ( status != ARES_SUCCESS )
{
break;