Ignore:
Timestamp:
May 23, 2008, 6:56:41 AM (17 years ago)
Author:
Paul Smedley
Message:

Update source to 3.0.29

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/libads/dns.c

    r62 r134  
    196196                return False;
    197197        }
     198
    198199        srv->hostname = talloc_strdup( ctx, dcname );
     200
     201        DEBUG(10,("ads_dns_parse_rr_srv: Parsed %s [%u, %u, %u]\n",
     202                  srv->hostname,
     203                  srv->priority,
     204                  srv->weight,
     205                  srv->port));
    199206
    200207        return True;
     
    275282{
    276283        uint8 *buffer = NULL;
    277         size_t buf_len;
     284        size_t buf_len = 0;
    278285        int resp_len = NS_PACKETSZ;     
    279286       
     
    304311                        return NT_STATUS_UNSUCCESSFUL;
    305312                }
    306         } while ( buf_len < resp_len && resp_len < MAX_DNS_PACKET_SIZE );
    307        
     313
     314                /* On AIX, Solaris, and possibly some older glibc systems (e.g. SLES8)
     315                   truncated replies never give back a resp_len > buflen
     316                   which ends up causing DNS resolve failures on large tcp DNS replies */
     317
     318                if (buf_len == resp_len) {
     319                        if (resp_len == MAX_DNS_PACKET_SIZE) {
     320                                DEBUG(1,("dns_send_req: DNS reply too large when resolving %s\n",
     321                                        name));
     322                                TALLOC_FREE( buffer );
     323                                return NT_STATUS_BUFFER_TOO_SMALL;
     324                        }
     325
     326                        resp_len = MIN(resp_len*2, MAX_DNS_PACKET_SIZE);
     327                }
     328
     329
     330        } while ( buf_len < resp_len && resp_len <= MAX_DNS_PACKET_SIZE );
     331
    308332        *buf = buffer;
    309333        *resp_length = resp_len;
     
    375399                struct dns_query q;
    376400
    377                 if ( !ads_dns_parse_query( ctx, buffer, buffer+resp_len, &p, &q ) ) {
    378                         DEBUG(1,("ads_dns_lookup_srv: Failed to parse query record!\n"));
     401                if (!ads_dns_parse_query(ctx, buffer,
     402                                        buffer+resp_len, &p, &q)) {
     403                        DEBUG(1,("ads_dns_lookup_srv: "
     404                                 "Failed to parse query record [%d]!\n", rrnum));
    379405                        return NT_STATUS_UNSUCCESSFUL;
    380406                }
     
    384410
    385411        for ( rrnum=0; rrnum<answer_count; rrnum++ ) {
    386                 if ( !ads_dns_parse_rr_srv( ctx, buffer, buffer+resp_len, &p, &dcs[rrnum] ) ) {
    387                         DEBUG(1,("ads_dns_lookup_srv: Failed to parse answer record!\n"));
     412                if (!ads_dns_parse_rr_srv(ctx, buffer, buffer+resp_len,
     413                                        &p, &dcs[rrnum])) {
     414                        DEBUG(1,("ads_dns_lookup_srv: "
     415                                 "Failed to parse answer recordi [%d]!\n", rrnum));
    388416                        return NT_STATUS_UNSUCCESSFUL;
    389417                }               
     
    397425                struct dns_rr rr;
    398426
    399                 if ( !ads_dns_parse_rr( ctx, buffer, buffer+resp_len, &p, &rr ) ) {
    400                         DEBUG(1,("ads_dns_lookup_srv: Failed to parse authority record!\n"));
     427                if (!ads_dns_parse_rr( ctx, buffer,
     428                                        buffer+resp_len, &p, &rr)) {
     429                        DEBUG(1,("ads_dns_lookup_srv: "
     430                                 "Failed to parse authority record! [%d]\n", rrnum));
    401431                        return NT_STATUS_UNSUCCESSFUL;
    402432                }
     
    409439                int i;
    410440
    411                 if ( !ads_dns_parse_rr( ctx, buffer, buffer+resp_len, &p, &rr ) ) {
    412                         DEBUG(1,("ads_dns_lookup_srv: Failed to parse additional records section!\n"));
     441                if (!ads_dns_parse_rr(ctx, buffer, buffer+resp_len,
     442                                        &p, &rr)) {
     443                        DEBUG(1,("ads_dns_lookup_srv: Failed "
     444                                 "to parse additional records section! [%d]\n", rrnum));
    413445                        return NT_STATUS_UNSUCCESSFUL;
    414446                }
Note: See TracChangeset for help on using the changeset viewer.