Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 May 2009 20:00:30 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r192848 - head/sys/netinet
Message-ID:  <200905262000.n4QK0UVx071957@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue May 26 20:00:30 2009
New Revision: 192848
URL: http://svn.freebsd.org/changeset/base/192848

Log:
  Correct the sense of a test so that this filter always waits for the full
  request to arrive.  Previously it would end up returning as soon as the
  request length stored in the first two bytes had arrived.
  
  Reviewed by:	dwmalone
  MFC after:	1 week

Modified:
  head/sys/netinet/accf_dns.c

Modified: head/sys/netinet/accf_dns.c
==============================================================================
--- head/sys/netinet/accf_dns.c	Tue May 26 19:39:09 2009	(r192847)
+++ head/sys/netinet/accf_dns.c	Tue May 26 20:00:30 2009	(r192848)
@@ -78,7 +78,7 @@ sohasdns(struct socket *so, void *arg, i
 	if (sb->sb_cc >= sb->sb_hiwat || sb->sb_mbcnt >= sb->sb_mbmax)
 		goto ready;
 
-	/* Check and see if we have a request. */
+	/* Check to see if we have a request. */
 	if (skippacket(sb) == DNS_WAIT)
 		return;
 
@@ -128,7 +128,7 @@ skippacket(struct sockbuf *sb) {
 	q.len = sb->sb_cc;
 
 	GET16(p, packlen);
-	if (packlen + 2 < q.len)
+	if (packlen + 2 > q.len)
 		return DNS_WAIT;
 
 	return DNS_OK;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905262000.n4QK0UVx071957>