diff options
| author | Michael Biebl <biebl@debian.org> | 2019-08-06 22:46:20 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2019-08-06 22:46:20 +0200 |
| commit | 5c79b900b59a5ad162ecc836e424468207ff031e (patch) | |
| tree | 2f529ff5c2d8531a2bf2973d96e316786eee9799 /shared | |
| parent | 2e5fa45ddfbb5cffa1e78221f1cea706e2f298af (diff) | |
New upstream version 1.20.0 upstream/1.20.0
Diffstat (limited to 'shared')
| -rw-r--r-- | shared/n-acd/src/n-acd.c | 6 | ||||
| -rw-r--r-- | shared/n-dhcp4/src/n-dhcp4-c-lease.c | 5 | ||||
| -rw-r--r-- | shared/n-dhcp4/src/n-dhcp4-outgoing.c | 4 | ||||
| -rw-r--r-- | shared/nm-glib-aux/nm-hash-utils.h | 3 | ||||
| -rw-r--r-- | shared/nm-glib-aux/nm-keyfile-aux.c | 2 | ||||
| -rw-r--r-- | shared/nm-glib-aux/nm-shared-utils.c | 15 | ||||
| -rw-r--r-- | shared/nm-version-macros.h | 4 |
7 files changed, 23 insertions, 16 deletions
diff --git a/shared/n-acd/src/n-acd.c b/shared/n-acd/src/n-acd.c index a0a48c58..d434d1d1 100644 --- a/shared/n-acd/src/n-acd.c +++ b/shared/n-acd/src/n-acd.c @@ -127,8 +127,10 @@ static int n_acd_socket_new(int *fdp, int fd_bpf_prog, NAcdConfig *config) { if (fd_bpf_prog >= 0) { r = setsockopt(s, SOL_SOCKET, SO_ATTACH_BPF, &fd_bpf_prog, sizeof(fd_bpf_prog)); - if (r < 0) - return -c_errno(); + if (r < 0) { + r = -c_errno(); + goto error; + } } r = bind(s, (struct sockaddr *)&address, sizeof(address)); diff --git a/shared/n-dhcp4/src/n-dhcp4-c-lease.c b/shared/n-dhcp4/src/n-dhcp4-c-lease.c index db1ffbae..208ad92a 100644 --- a/shared/n-dhcp4/src/n-dhcp4-c-lease.c +++ b/shared/n-dhcp4/src/n-dhcp4-c-lease.c @@ -44,10 +44,7 @@ static int n_dhcp4_incoming_get_timeouts(NDhcp4Incoming *message, uint64_t *t1p, } else if (u32 == UINT32_MAX) { lifetime = UINT64_MAX; } else { - if (u32 == UINT32_MAX) - lifetime = UINT64_MAX; - else - lifetime = u32 * (1000000000ULL); + lifetime = u32 * (1000000000ULL); } r = n_dhcp4_incoming_query_t2(message, &u32); diff --git a/shared/n-dhcp4/src/n-dhcp4-outgoing.c b/shared/n-dhcp4/src/n-dhcp4-outgoing.c index c44b5880..99123308 100644 --- a/shared/n-dhcp4/src/n-dhcp4-outgoing.c +++ b/shared/n-dhcp4/src/n-dhcp4-outgoing.c @@ -54,8 +54,6 @@ int n_dhcp4_outgoing_new(NDhcp4Outgoing **outgoingp, size_t max_size, uint8_t overload) { _c_cleanup_(n_dhcp4_outgoing_freep) NDhcp4Outgoing *outgoing = NULL; - c_assert(!(overload & ~(N_DHCP4_OVERLOAD_FILE | N_DHCP4_OVERLOAD_SNAME))); - /* * Make sure the minimum limit is bigger than the maximum protocol * header plus the DHCP-message-header plus a single OPTION_END byte. @@ -64,6 +62,8 @@ int n_dhcp4_outgoing_new(NDhcp4Outgoing **outgoingp, size_t max_size, uint8_t ov sizeof(NDhcp4Message) + 1, "Invalid minimum IP packet limit"); + c_assert(!(overload & ~(N_DHCP4_OVERLOAD_FILE | N_DHCP4_OVERLOAD_SNAME))); + outgoing = calloc(1, sizeof(*outgoing)); if (!outgoing) return -ENOMEM; diff --git a/shared/nm-glib-aux/nm-hash-utils.h b/shared/nm-glib-aux/nm-hash-utils.h index f13e0b6d..aa0a3d7c 100644 --- a/shared/nm-glib-aux/nm-hash-utils.h +++ b/shared/nm-glib-aux/nm-hash-utils.h @@ -26,6 +26,9 @@ /*****************************************************************************/ +#define NM_HASH_SEED_16(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af) \ + ((const guint8[16]) { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af }) + void nm_hash_siphash42_init (CSipHash *h, guint static_seed); /* Siphash24 of binary buffer @arr and @len, using the randomized seed from diff --git a/shared/nm-glib-aux/nm-keyfile-aux.c b/shared/nm-glib-aux/nm-keyfile-aux.c index 0257bcca..989c773f 100644 --- a/shared/nm-glib-aux/nm-keyfile-aux.c +++ b/shared/nm-glib-aux/nm-keyfile-aux.c @@ -125,7 +125,7 @@ nm_key_file_db_ref (NMKeyFileDB *self) g_return_val_if_fail (_IS_KEY_FILE_DB (self, FALSE, TRUE), NULL); - nm_assert (self->ref_count <= G_MAXUINT); + nm_assert (self->ref_count < G_MAXUINT); self->ref_count++; return self; } diff --git a/shared/nm-glib-aux/nm-shared-utils.c b/shared/nm-glib-aux/nm-shared-utils.c index c8a253a6..9bfd5ae2 100644 --- a/shared/nm-glib-aux/nm-shared-utils.c +++ b/shared/nm-glib-aux/nm-shared-utils.c @@ -1939,7 +1939,7 @@ nm_utils_buf_utf8safe_escape (gconstpointer buf, gssize buflen, NMUtilsStrUtf8Sa break; s = &p[1]; - g_utf8_validate (s, buflen, &p); + (void) g_utf8_validate (s, buflen, &p); } while (TRUE); *to_free = g_string_free (gstr, FALSE); @@ -2834,10 +2834,15 @@ nm_utils_g_slist_find_str (const GSList *list, int nm_utils_g_slist_strlist_cmp (const GSList *a, const GSList *b) { - for (; a && b; a = a->next, b = b->next) + while (TRUE) { + if (!a) + return !b ? 0 : -1; + if (!b) + return 1; NM_CMP_DIRECT_STRCMP0 (a->data, b->data); - NM_CMP_SELF (a, b); - return 0; + a = a->next; + b = b->next; + } } /*****************************************************************************/ @@ -2878,7 +2883,7 @@ _nm_utils_user_data_unpack (gpointer user_data, int nargs, ...) } va_end (ap); - g_slice_free1 (((gsize) nargs) * sizeof (gconstpointer), user_data); + g_slice_free1 (((gsize) nargs) * sizeof (gconstpointer), data); } /*****************************************************************************/ diff --git a/shared/nm-version-macros.h b/shared/nm-version-macros.h index c8cc7de1..a6779655 100644 --- a/shared/nm-version-macros.h +++ b/shared/nm-version-macros.h @@ -36,7 +36,7 @@ * Evaluates to the minor version number of NetworkManager which this source * is compiled against. */ -#define NM_MINOR_VERSION (19) +#define NM_MINOR_VERSION (20) /** * NM_MICRO_VERSION: @@ -44,7 +44,7 @@ * Evaluates to the micro version number of NetworkManager which this source * compiled against. */ -#define NM_MICRO_VERSION (90) +#define NM_MICRO_VERSION (0) /** * NM_CHECK_VERSION: |