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
This commit is contained in:
John Baldwin 2009-05-26 20:00:30 +00:00
parent 15814131d4
commit 256d7a8a16

View File

@ -78,7 +78,7 @@ sohasdns(struct socket *so, void *arg, int waitflag)
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;