Fix use of getrandom() for Linux and WITH_TLS=no.

pull/1304/head
Roger A. Light 6 years ago
parent ef3e52d40b
commit b1298dff54

@ -5,6 +5,10 @@ Broker:
- Fix detection of incoming v3.1/v3.1.1 bridges. Closes #1263. - Fix detection of incoming v3.1/v3.1.1 bridges. Closes #1263.
- Fix default max_topic_alias listener config not being copied to the in-use - Fix default max_topic_alias listener config not being copied to the in-use
listener when compiled without TLS support. listener when compiled without TLS support.
- Fix random number generation if compiling using WITH_TLS=no and on Linux
with glibc >= 2.25. Without this fix, no random numbers would be generated
for e.g. on broker client id generation, and so clients connecting expecting
this feature would be unable to connect.
Clients: Clients:
- Fix -L url parsing when `/topic` part is missing. - Fix -L url parsing when `/topic` part is missing.

@ -326,7 +326,7 @@ int util__random_bytes(void *bytes, int count)
rc = MOSQ_ERR_SUCCESS; rc = MOSQ_ERR_SUCCESS;
} }
#elif defined(__GLIBC__) && __GLIBC_PREREQ(2, 25) #elif defined(__GLIBC__) && __GLIBC_PREREQ(2, 25)
if(getrandom(bytes, count, 0) == 0){ if(getrandom(bytes, count, 0) == count){
rc = MOSQ_ERR_SUCCESS; rc = MOSQ_ERR_SUCCESS;
} }
#elif defined(WIN32) #elif defined(WIN32)

Loading…
Cancel
Save