projects
/
platform
/
upstream
/
nbd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36dbef9
)
Make assertions about state in negotiation function
author
Wouter Verhelst
<w@uter.be>
Fri, 23 Dec 2011 17:58:54 +0000
(18:58 +0100)
committer
Wouter Verhelst
<w@uter.be>
Fri, 23 Dec 2011 17:58:54 +0000
(18:58 +0100)
nbd-server.c
patch
|
blob
|
history
diff --git
a/nbd-server.c
b/nbd-server.c
index
810673e
..
0ecf0e8
100644
(file)
--- a/
nbd-server.c
+++ b/
nbd-server.c
@@
-1498,6
+1498,7
@@
CLIENT* negotiate(int net, CLIENT *client, GArray* servers, int phase) {
uint64_t magic;
memset(zeros, '\0', sizeof(zeros));
+ g_assert(((phase & NEG_INIT) && (phase & NEG_MODERN)) || client);
if(phase & NEG_INIT) {
/* common */
if (write(net, INIT_PASSWD, 8) < 0) {