From: Wouter Verhelst Date: Mon, 11 Apr 2016 19:22:35 +0000 (+0200) Subject: Add missing htons/ntohl calls X-Git-Tag: nbd-3.15~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a50ad0440f665c4d84256d96323eecc210222f5d;p=platform%2Fupstream%2Fnbd.git Add missing htons/ntohl calls --- diff --git a/tests/run/nbd-tester-client.c b/tests/run/nbd-tester-client.c index 592930e..f335618 100644 --- a/tests/run/nbd-tester-client.c +++ b/tests/run/nbd-tester-client.c @@ -391,9 +391,11 @@ int setup_connection_common(int sock, char *name, CONNECTION_TYPE ctype, /* handshake flags */ READ_ALL_ERRCHK(sock, &handshakeflags, sizeof(handshakeflags), err, "Could not read reserved field: %s", strerror(errno)); + handshakeflags = ntohs(handshakeflags); /* negotiation flags */ if (handshakeflags & NBD_FLAG_FIXED_NEWSTYLE) negotiationflags |= NBD_FLAG_C_FIXED_NEWSTYLE; + negotiationflags = htonl(negotiationflags); WRITE_ALL_ERRCHK(sock, &negotiationflags, sizeof(negotiationflags), err, "Could not write reserved field: %s", strerror(errno)); /* magic */