diff options
author | jhb <jhb@FreeBSD.org> | 2009-05-26 20:00:30 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2009-05-26 20:00:30 +0000 |
commit | 1c5e5de302cdbb97f2f6077d93e96dbb7a68eaf9 (patch) | |
tree | d1f66036b5d51f01583c4ae0fea64994ea7c7d3d /sys/netinet | |
parent | a7e9e5d3f812030f243c78ab7f2cbccc4fd2a843 (diff) | |
download | FreeBSD-src-1c5e5de302cdbb97f2f6077d93e96dbb7a68eaf9.zip FreeBSD-src-1c5e5de302cdbb97f2f6077d93e96dbb7a68eaf9.tar.gz |
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
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/accf_dns.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/accf_dns.c b/sys/netinet/accf_dns.c index 1db9076..8789906 100644 --- a/sys/netinet/accf_dns.c +++ b/sys/netinet/accf_dns.c @@ -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; |