summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libstore/nbd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libstore/nbd.c b/libstore/nbd.c
index 9130db43..547d3bd6 100644
--- a/libstore/nbd.c
+++ b/libstore/nbd.c
@@ -325,7 +325,7 @@ nbdopen (const char *name, int *mod_flags,
ofs += cc;
} while (cc > 0 && ofs < sizeof ns);
- if (cc < sizeof ns
+ if (ofs != sizeof ns
|| memcmp (ns.magic, NBD_INIT_MAGIC, sizeof ns.magic) != 0)
{
close (sock);