Ignore:
Timestamp:
May 23, 2019 1:42:27 PM (2 years ago)
Author:
riza
Message:

Close #2200: Ignore/discard DNS SRV response with truncated flag set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/src/pjlib-util/srv_resolver.c

    r5996 r6000  
    586586        query_job->q_srv = NULL; 
    587587 
    588         if (status == PJ_SUCCESS && pkt->hdr.anscount != 0) { 
    589             /* Got SRV response, build server entry. If A records are available 
    590              * in additional records section of the DNS response, save them too. 
    591              */ 
    592             build_server_entries(query_job, pkt); 
    593  
    594         } else if (status != PJ_SUCCESS) { 
     588        if (status == PJ_SUCCESS) { 
     589            if (PJ_DNS_GET_TC(pkt->hdr.flags)) { 
     590                /* Got truncated answer, the standard recommends to follow up 
     591                 * the query using TCP. Since we currently don't support it, 
     592                 * just return error. 
     593                 */ 
     594                PJ_LOG(4,(query_job->objname, 
     595                          "Discard truncated DNS SRV response for %.*s", 
     596                          (int)query_job->full_name.slen, 
     597                          query_job->full_name.ptr)); 
     598 
     599                status = PJ_EIGNORED; 
     600                query_job->last_error = status; 
     601                goto on_error; 
     602            } else if (pkt->hdr.anscount != 0) { 
     603                /* Got SRV response, build server entry. If A records are 
     604                 * available in additional records section of the DNS response, 
     605                 * save them too. 
     606                 */ 
     607                build_server_entries(query_job, pkt); 
     608            } 
     609 
     610        } else { 
    595611            char errmsg[PJ_ERR_MSG_SIZE]; 
    596612 
Note: See TracChangeset for help on using the changeset viewer.