From 256d7a8a16d5fc06be2c337883b607f849e467d9 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 26 May 2009 20:00:30 +0000 Subject: [PATCH] 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 --- sys/netinet/accf_dns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/accf_dns.c b/sys/netinet/accf_dns.c index 1db907675790..87899063a97a 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;