~ubuntu-branches/ubuntu/saucy/maradns/saucy

« back to all changes in this revision

Viewing changes to server/recursive.c

  • Committer: Bazaar Package Importer
  • Author(s): Kai Hendry
  • Date: 2006-06-18 11:09:28 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060618110928-vlbyk1d4rm5cbhmm
Tags: 1.2.07.6-1
* New upstream release
* Microsoft doesn't follow DNS standards (Closes: #373701)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1919
1919
                        }
1920
1920
                    goto cleanup;
1921
1921
                    }
 
1922
                /* Check to see if this is the CNAME form of the answer.
 
1923
                 * If not... */
1922
1924
                if(substring_issame_case(uindata,offset,len,query) != 1) {
 
1925
                    int rdlength;
 
1926
                    /* We look at the next answer given and discard this 
 
1927
                     * one; we used to discard the entire DNS packet
 
1928
                     * at this point but that, alas, breaks microsoft.com */
1923
1929
                    if(rlog_level >= 4) {
1924
1930
                        log_lock();
1925
1931
                        show_timestamp();
1926
 
                        printf("substring_issame_case problem\n");
 
1932
                        printf("substring_issame_case is skipping answer\n");
1927
1933
                        log_unlock();
1928
1934
                        }
1929
 
                    goto minus2;
 
1935
                    /* Jump past CLASS and TTL */
 
1936
                    offset += len + 6;
 
1937
                    /* Bounds checking, as always */
 
1938
                    if(offset + 2 > uindata->unit_count) {
 
1939
                        if(rlog_level >= 4) {
 
1940
                            log_lock();
 
1941
                            show_timestamp();
 
1942
                            printf("uindata string truncated\n");
 
1943
                            log_unlock();
 
1944
                            }
 
1945
                        goto minus2;
 
1946
                        }
 
1947
                    /* Find out how long this answer is */
 
1948
                    rdlength = ((*(uindata->string + offset ) & 0xff) << 8) 
 
1949
                               + *(uindata->string + offset + 1);
 
1950
                    /* And jump past this answer */
 
1951
                    offset += rdlength + 2;
 
1952
                    /* Again, bounds checking */
 
1953
                    if(offset >= uindata->unit_count) {
 
1954
                        if(rlog_level >= 4) {
 
1955
                            log_lock();
 
1956
                            show_timestamp();
 
1957
                            printf("uindata string ended\n");
 
1958
                            log_unlock();
 
1959
                            }
 
1960
                        goto minus2;
 
1961
                        }
 
1962
                    /* And now let's reset some stuff so we can inspect 
 
1963
                     * the next answer the remote server gave us */
 
1964
                    counter--;
 
1965
                    is_arpa_address = 0;
 
1966
                    if(change_rtype(query,cname_original_record) == JS_ERROR) {
 
1967
                        if(rlog_level >= 4) {
 
1968
                            log_lock();
 
1969
                            show_timestamp();
 
1970
                            printf("change_rtype restore problem\n");
 
1971
                            log_unlock();
 
1972
                            }
 
1973
                        goto cleanup;
 
1974
                        }
 
1975
                    /* And jump back to the beginning of this do { loop */
 
1976
                    continue;
1930
1977
                    }
1931
1978
                /* If it is a CNAME answer, DNS servers have this way
1932
1979
                   of politely also giving us the IP the CNAME points to