summaryrefslogtreecommitdiffstats
path: root/src/server/rpc.c
diff options
context:
space:
mode:
authorSimon Rettberg2017-10-24 11:27:44 +0200
committerSimon Rettberg2017-10-24 11:27:44 +0200
commita0fbfe1c6d6f42b4c2704c882beda1c4cafe5016 (patch)
tree1a962a61adec6f3068cdba1e31129e14b5fada51 /src/server/rpc.c
parentcmake: Move sample config to /etc/dnbd3-server aswell (diff)
downloaddnbd3-a0fbfe1c6d6f42b4c2704c882beda1c4cafe5016.tar.gz
dnbd3-a0fbfe1c6d6f42b4c2704c882beda1c4cafe5016.tar.xz
dnbd3-a0fbfe1c6d6f42b4c2704c882beda1c4cafe5016.zip
[SERVER] Fix types or add explicit casts everywhere we might have type conversion problems
Diffstat (limited to 'src/server/rpc.c')
-rw-r--r--src/server/rpc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/rpc.c b/src/server/rpc.c
index 7f57b0a..7b558ce 100644
--- a/src/server/rpc.c
+++ b/src/server/rpc.c
@@ -250,7 +250,7 @@ static void addacl(int argc, char **argv, void *data UNUSED)
}
}
memcpy( aclRules[aclCount].host, host.addr, 16 );
- aclRules[aclCount].bytes = bits / 8;
+ aclRules[aclCount].bytes = (int)( bits / 8 );
aclRules[aclCount].bitMask = 0;
aclRules[aclCount].permissions = mask;
bits %= 8;
@@ -258,7 +258,7 @@ static void addacl(int argc, char **argv, void *data UNUSED)
for (long int i = 0; i < bits; ++i) {
aclRules[aclCount].bitMask = ( aclRules[aclCount].bitMask >> 1 ) | 0x80;
}
- aclRules[aclCount].host[aclRules[aclCount].bytes] &= aclRules[aclCount].bitMask;
+ aclRules[aclCount].host[aclRules[aclCount].bytes] &= (uint8_t)aclRules[aclCount].bitMask;
}
// We now have .bytes set to the number of bytes to memcmp.
// In case we have an odd bitmask, .bitMask will be != 0, so when comparing,