From 49da7acdd43a824c53f36ad4a12d9d39dc81834a Mon Sep 17 00:00:00 2001
From: Richard Nyberg <rnyberg@murmeldjur.se>
Date: Mon, 16 Jan 2006 17:05:30 +0000
Subject: [PATCH] Fix conditional I broke in r131.

---
 btpd/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/btpd/net.c b/btpd/net.c
index fca3143..c728efd 100644
--- a/btpd/net.c
+++ b/btpd/net.c
@@ -235,7 +235,7 @@ net_dispatch_msg(struct peer *p, const char *buf)
             length = net_read32(buf + 8);
             if ((length > PIECE_BLOCKLEN
                     || index >= p->n->tp->meta.npieces
-                    || cm_has_piece(p->n->tp, index)
+                    || !cm_has_piece(p->n->tp, index)
                     || begin + length > torrent_piece_size(p->n->tp, index))) {
                 btpd_log(BTPD_L_MSG, "bad request: (%u, %u, %u) from %p\n",
                          index, begin, length, p);