From: hno <> Date: Tue, 10 May 2005 17:46:41 +0000 (+0000) Subject: Remove redundant check for oversized DNS responses X-Git-Tag: SQUID_3_0_PRE4~752 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0343293b321ce29b16d68693a85f43fa971b259b;p=thirdparty%2Fsquid.git Remove redundant check for oversized DNS responses --- diff --git a/src/dns_internal.cc b/src/dns_internal.cc index e1c880a8ce..e7494da5f6 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.cc,v 1.75 2005/05/10 10:39:56 hno Exp $ + * $Id: dns_internal.cc,v 1.76 2005/05/10 11:46:41 hno Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -674,7 +674,7 @@ idnsRead(int fd, void *data) from_len = sizeof(from); memset(&from, '\0', from_len); - len = comm_udp_recvfrom(fd, rbuf, 512, 0, (struct sockaddr *) &from, &from_len); + len = comm_udp_recvfrom(fd, rbuf, sizeof(rbuf), 0, (struct sockaddr *) &from, &from_len); if (len == 0) break; @@ -720,26 +720,6 @@ idnsRead(int fd, void *data) continue; } - if (len > 512) { - /* - * Check for non-conforming replies. RFC 1035 says - * DNS/UDP messages must be 512 octets or less. If we - * get one that is too large, we generate a warning - * and then pretend that we only got 512 octets. This - * should prevent the rfc1035.c code from reading past - * the end of our buffer. - */ - static int other_large_pkts = 0; - int x; - x = (ns < 0) ? ++other_large_pkts : ++nameservers[ns].large_pkts; - - if (isPowTen(x)) - debug(78, 1) ("WARNING: Got %d large DNS replies from %s\n", - x, inet_ntoa(from.sin_addr)); - - len = 512; - } - idnsGrokReply(rbuf, len); }