From c50a67520e6fb473eac298c89b8a408a380cfbb4 Mon Sep 17 00:00:00 2001 From: Wouter Verhelst Date: Tue, 12 Feb 2013 00:07:36 +0100 Subject: [PATCH] Be a bit more helpful when someone tries something silly. --- nbd-client.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nbd-client.c b/nbd-client.c index 1445621..83a68f8 100644 --- a/nbd-client.c +++ b/nbd-client.c @@ -278,8 +278,11 @@ void negotiate(int sock, u64 *rsize64, u32 *flags, char* name, uint32_t needed_f if (write(sock, name, strlen(name)) < 0) err("Failed/2.4: %m"); } else { - if (magic != cliserv_magic) - err("Not enough cliserv_magic"); + if (magic != cliserv_magic) { + if(magic != opts_magic) + err("Not enough cliserv_magic"); + else + err("It looks like you're trying to connect to a newstyle server with the oldstyle protocol. Try the -N option."); printf("."); } -- 2.34.1