summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorSimon Rettberg2018-04-05 18:31:22 +0200
committerSimon Rettberg2018-04-05 18:31:22 +0200
commitde824f77fcf7a9164d0e52cf9979c285174426db (patch)
tree4599c11a3f77d1e865299e31b6fd56c971d68c55 /src/shared
parent[KERNEL] Pre/post 4.11 handling of request ops (diff)
downloaddnbd3-de824f77fcf7a9164d0e52cf9979c285174426db.tar.gz
dnbd3-de824f77fcf7a9164d0e52cf9979c285174426db.tar.xz
dnbd3-de824f77fcf7a9164d0e52cf9979c285174426db.zip
[SHARED] Reset errno
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/protocol.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shared/protocol.h b/src/shared/protocol.h
index 1665e70..6f1cca6 100644
--- a/src/shared/protocol.h
+++ b/src/shared/protocol.h
@@ -133,10 +133,12 @@ static inline bool dnbd3_get_crc32(int sock, uint32_t *master, void *buffer, siz
static inline bool dnbd3_select_image_reply(serialized_buffer_t *buffer, int sock, uint16_t *protocol_version, char **name, uint16_t *rid,
uint64_t *imageSize)
{
+ errno = 0;
dnbd3_reply_t reply;
if ( !dnbd3_get_reply( sock, &reply ) ) {
return false;
}
+ errno = 0;
if ( reply.cmd != CMD_SELECT_IMAGE || reply.size < 3 || reply.size > MAX_PAYLOAD ) {
return false;
}