mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 12:28:11 +02:00
merge: branch 'bg/fix-compilation'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1911
This commit is contained in:
commit
0bb37455c3
4 changed files with 8 additions and 23 deletions
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
guint num;
|
guint num;
|
||||||
const char *cmds[];
|
const char *cmds[16];
|
||||||
} DcbExpected;
|
} DcbExpected;
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
|
||||||
|
|
@ -122,19 +122,13 @@ nm_team_link_watcher_new_ethtool(int delay_up, int delay_down, GError **error)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
NM_PRAGMA_WARNING_DISABLE("-Warray-bounds")
|
watcher = g_malloc(sizeof(NMTeamLinkWatcher));
|
||||||
NM_PRAGMA_WARNING_DISABLE("-Walloc-size")
|
|
||||||
|
|
||||||
watcher = g_malloc(nm_offsetofend(NMTeamLinkWatcher, ethtool));
|
|
||||||
|
|
||||||
watcher->ref_count = 1;
|
watcher->ref_count = 1;
|
||||||
watcher->type = LINK_WATCHER_ETHTOOL;
|
watcher->type = LINK_WATCHER_ETHTOOL;
|
||||||
watcher->ethtool.delay_up = delay_up;
|
watcher->ethtool.delay_up = delay_up;
|
||||||
watcher->ethtool.delay_down = delay_down;
|
watcher->ethtool.delay_down = delay_down;
|
||||||
|
|
||||||
NM_PRAGMA_WARNING_REENABLE
|
|
||||||
NM_PRAGMA_WARNING_REENABLE
|
|
||||||
|
|
||||||
return watcher;
|
return watcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2809,16 +2809,8 @@ NMTeamSetting *
|
||||||
nm_team_setting_new(gboolean is_port, const char *js_str)
|
nm_team_setting_new(gboolean is_port, const char *js_str)
|
||||||
{
|
{
|
||||||
NMTeamSetting *self;
|
NMTeamSetting *self;
|
||||||
gsize l;
|
|
||||||
|
|
||||||
G_STATIC_ASSERT_EXPR(sizeof(*self) == sizeof(self->_data_priv));
|
self = g_malloc0(sizeof(NMTeamSetting));
|
||||||
G_STATIC_ASSERT_EXPR(
|
|
||||||
sizeof(*self)
|
|
||||||
== NM_MAX(nm_offsetofend(NMTeamSetting, d.master), nm_offsetofend(NMTeamSetting, d.port)));
|
|
||||||
|
|
||||||
l = is_port ? nm_offsetofend(NMTeamSetting, d.port) : nm_offsetofend(NMTeamSetting, d.master);
|
|
||||||
|
|
||||||
self = g_malloc0(l);
|
|
||||||
|
|
||||||
self->_data_priv.is_port = is_port;
|
self->_data_priv.is_port = is_port;
|
||||||
self->_data_priv.strict_validated = TRUE;
|
self->_data_priv.strict_validated = TRUE;
|
||||||
|
|
|
||||||
|
|
@ -415,8 +415,7 @@ nm_uuid_generate_from_string_str(const char *s,
|
||||||
* case the result is different from an empty array.
|
* case the result is different from an empty array.
|
||||||
* @len: if negative, @strv is a NULL terminated array. Otherwise,
|
* @len: if negative, @strv is a NULL terminated array. Otherwise,
|
||||||
* it is the length of the strv array. In the latter case it may
|
* it is the length of the strv array. In the latter case it may
|
||||||
* also contain NULL strings. The result hashes differently depending
|
* also contain NULL strings.
|
||||||
* on whether we have a NULL terminated strv array or given length.
|
|
||||||
*
|
*
|
||||||
* Returns a @uuid_type UUID based on the concatenated C strings.
|
* Returns a @uuid_type UUID based on the concatenated C strings.
|
||||||
* It does not simply concatenate them, but also includes the
|
* It does not simply concatenate them, but also includes the
|
||||||
|
|
@ -434,9 +433,9 @@ nm_uuid_generate_from_strings_strv(NMUuidType uuid_type,
|
||||||
{
|
{
|
||||||
nm_auto_str_buf NMStrBuf str = NM_STR_BUF_INIT_A(NM_UTILS_GET_NEXT_REALLOC_SIZE_232, TRUE);
|
nm_auto_str_buf NMStrBuf str = NM_STR_BUF_INIT_A(NM_UTILS_GET_NEXT_REALLOC_SIZE_232, TRUE);
|
||||||
gsize slen;
|
gsize slen;
|
||||||
const char *s = NULL;
|
const char *s;
|
||||||
|
|
||||||
if (len >= 0) {
|
if (len > 0) {
|
||||||
gboolean has_nulls = FALSE;
|
gboolean has_nulls = FALSE;
|
||||||
gssize i;
|
gssize i;
|
||||||
|
|
||||||
|
|
@ -471,14 +470,14 @@ nm_uuid_generate_from_strings_strv(NMUuidType uuid_type,
|
||||||
* in the other cases). */
|
* in the other cases). */
|
||||||
slen = 1;
|
slen = 1;
|
||||||
s = "x";
|
s = "x";
|
||||||
} else if (!strv[0]) {
|
} else if (!strv[0] || len == 0) {
|
||||||
slen = 0;
|
slen = 0;
|
||||||
s = "";
|
s = "";
|
||||||
} else if (!strv[1]) {
|
} else if (!strv[1]) {
|
||||||
slen = strlen(strv[0]) + 1u;
|
slen = strlen(strv[0]) + 1u;
|
||||||
s = strv[0];
|
s = strv[0];
|
||||||
} else {
|
} else {
|
||||||
/* We concatenate the NUL termiated string, including the NUL
|
/* We concatenate the NUL terminated string, including the NUL
|
||||||
* character. This way, ("a","a"), ("aa"), ("aa","") all hash
|
* character. This way, ("a","a"), ("aa"), ("aa","") all hash
|
||||||
* differently. */
|
* differently. */
|
||||||
for (; strv[0]; strv++)
|
for (; strv[0]; strv++)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue