diff options
author | Thomas Haller <thaller@redhat.com> | 2021-01-05 09:27:41 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2021-01-05 09:28:41 +0100 |
commit | 6bdda3a923591b628cc86e1110e6610468c403af (patch) | |
tree | f998b7a08f09a623388b8eee02595a5e3a1281bf | |
parent | d34d82399518ae07e0d476764123e47864670fd5 (diff) | |
parent | 40d2931fd6d28f35336e1d563eca64e564f88f69 (diff) | |
download | NetworkManager-6bdda3a923591b628cc86e1110e6610468c403af.tar.gz |
systemd: merge branch systemd into master
-rw-r--r-- | shared/systemd/src/basic/siphash24.h | 12 | ||||
-rw-r--r-- | shared/systemd/src/shared/dns-domain.c | 2 | ||||
-rw-r--r-- | src/systemd/src/libsystemd-network/sd-dhcp-client.c | 4 |
3 files changed, 12 insertions, 6 deletions
diff --git a/shared/systemd/src/basic/siphash24.h b/shared/systemd/src/basic/siphash24.h index 37a9c6c351..e46f3cc5be 100644 --- a/shared/systemd/src/basic/siphash24.h +++ b/shared/systemd/src/basic/siphash24.h @@ -5,9 +5,9 @@ #include <inttypes.h> #include <stddef.h> #include <stdint.h> -#include <string.h> #include <sys/types.h> +#include "string-util.h" #include "time-util.h" #if 0 /* NM_IGNORED */ @@ -63,11 +63,15 @@ static inline void siphash24_compress_usec_t(usec_t in, struct siphash *state) { siphash24_compress(&in, sizeof in, state); } -static inline void siphash24_compress_string(const char *in, struct siphash *state) { - if (!in) +static inline void siphash24_compress_safe(const void *in, size_t inlen, struct siphash *state) { + if (inlen == 0) return; - siphash24_compress(in, strlen(in), state); + siphash24_compress(in, inlen, state); +} + +static inline void siphash24_compress_string(const char *in, struct siphash *state) { + siphash24_compress_safe(in, strlen_ptr(in), state); } uint64_t siphash24_finalize(struct siphash *state); diff --git a/shared/systemd/src/shared/dns-domain.c b/shared/systemd/src/shared/dns-domain.c index dff7e83a19..95e4a93afd 100644 --- a/shared/systemd/src/shared/dns-domain.c +++ b/shared/systemd/src/shared/dns-domain.c @@ -1289,7 +1289,7 @@ int dns_name_apply_idna(const char *name, char **ret) { int r; r = dlopen_idn(); - if (r == EOPNOTSUPP) { + if (r == -EOPNOTSUPP) { *ret = NULL; return 0; } diff --git a/src/systemd/src/libsystemd-network/sd-dhcp-client.c b/src/systemd/src/libsystemd-network/sd-dhcp-client.c index 95703aafc2..27a3476fcf 100644 --- a/src/systemd/src/libsystemd-network/sd-dhcp-client.c +++ b/src/systemd/src/libsystemd-network/sd-dhcp-client.c @@ -1278,9 +1278,11 @@ static int client_timeout_resend( break; case DHCP_STATE_STOPPED: - default: r = -EINVAL; goto error; + + default: + assert_not_reached("Unhandled choice"); } r = event_reset_time(client->event, &client->timeout_resend, |