clang-format: merge branch 'th/gitlab-ci-update'

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1242
This commit is contained in:
Thomas Haller 2022-07-06 11:09:28 +02:00
commit 8dff528195
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
35 changed files with 399 additions and 398 deletions

View file

@ -5,3 +5,4 @@
#
328fb90f3e0d4e35975aff63944ac0412d7893a5
740b092fda3d5f45102422f22884c88ea6c42858
d8a4b3bec28c48b3b9f2ed7d499922376a2e05c3

View file

@ -48,11 +48,11 @@ variables:
#
# This is done by running `ci-fairy generate-template` and possibly bumping
# ".default_tag".
FEDORA_TAG: '2022-06-27.0-2c10e7aed898'
UBUNTU_TAG: '2022-06-27.0-03a416b036a0'
DEBIAN_TAG: '2022-06-27.0-03a416b036a0'
CENTOS_TAG: '2022-06-27.0-2c10e7aed898'
ALPINE_TAG: '2022-06-27.0-72578ddac08c'
FEDORA_TAG: '2022-06-27.0-20f11105576e'
UBUNTU_TAG: '2022-06-27.0-1dbb38dce8f7'
DEBIAN_TAG: '2022-06-27.0-1dbb38dce8f7'
CENTOS_TAG: '2022-06-27.0-20f11105576e'
ALPINE_TAG: '2022-06-27.0-182d174255fc'
FEDORA_EXEC: 'bash .gitlab-ci/fedora-install.sh'
UBUNTU_EXEC: 'bash .gitlab-ci/debian-install.sh'
@ -724,24 +724,24 @@ t_fedora:35:
extends:
- .build@template
- .fdo.distribution-image@fedora
- .nm_artifacts
- .nm_artifacts_debug
variables:
FDO_DISTRIBUTION_VERSION: '35'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "fedora:35@container-prep"
when: manual
t_fedora:36:
extends:
- .build@template
- .fdo.distribution-image@fedora
- .nm_artifacts_debug
- .nm_artifacts
variables:
FDO_DISTRIBUTION_VERSION: '36'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "fedora:36@container-prep"
when: manual
t_fedora:37:
extends:
@ -993,10 +993,10 @@ check-patch:
extends:
- .fdo.distribution-image@fedora
variables:
FDO_DISTRIBUTION_VERSION: '35'
FDO_DISTRIBUTION_VERSION: '36'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "fedora:35@container-prep"
- "fedora:36@container-prep"
stage: test
script:
- date '+%Y%m%d-%H%M%S'; NM_CHECKPATCH_FETCH_UPSTREAM=1 contrib/scripts/checkpatch-feature-branch.sh
@ -1006,10 +1006,10 @@ check-tree:
extends:
- .fdo.distribution-image@fedora
variables:
FDO_DISTRIBUTION_VERSION: '35'
FDO_DISTRIBUTION_VERSION: '36'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "fedora:35@container-prep"
- "fedora:36@container-prep"
stage: test
script:
- date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-python-black-format.sh --check
@ -1028,9 +1028,9 @@ pages:
only:
- main
dependencies:
- t_fedora:35
- t_fedora:36
needs:
- t_fedora:35
- t_fedora:36
triage:issues:
stage: triage

View file

@ -65,4 +65,4 @@ distributions:
# specifies which of the above distros is used as source for pages
pages_build:
name: fedora
version: '35'
version: '36'

View file

@ -10,7 +10,7 @@ die() {
DIR="$(realpath "$(dirname "$0")/../../")"
cd "$DIR"
FEDORA_VERSION=35
FEDORA_VERSION=36
PODNAME="nm-code-format-f$FEDORA_VERSION"

View file

@ -13647,14 +13647,14 @@ spawn_ping(NMDevice *self)
gs_free char *str_timeout = NULL;
gs_free char *tmp_str = NULL;
const char *args[] = {priv->gw_ping.binary,
"-I",
nm_device_get_ip_iface(self),
"-c",
"1",
"-w",
NULL,
priv->gw_ping.address,
NULL};
"-I",
nm_device_get_ip_iface(self),
"-c",
"1",
"-w",
NULL,
priv->gw_ping.address,
NULL};
gs_free_error GError *error = NULL;
gboolean ret;

View file

@ -1587,7 +1587,7 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
json_t *items;
json_t *external_ids;
json_error_t json_error = {
0,
0,
};
void *iter;
const char *name;
@ -1988,7 +1988,7 @@ ovsdb_got_msg(NMOvsdb *self, json_t *msg)
{
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
json_error_t json_error = {
0,
0,
};
json_t *json_id = NULL;
json_int_t id = (json_int_t) -1;
@ -2130,7 +2130,7 @@ ovsdb_read_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
gssize size;
json_t *msg;
json_error_t json_error = {
0,
0,
};
size = g_input_stream_read_finish(stream, res, &error);

View file

@ -3180,21 +3180,21 @@ ensure_hotspot_frequency(NMDeviceWifi *self, NMSettingWireless *s_wifi, NMWifiAP
gsize ssid_len;
const guint8 *ssid_data;
const guint8 random_seed[16] = {0x9a,
0xdc,
0x86,
0x9a,
0xa8,
0xa2,
0x07,
0x97,
0xbe,
0x6d,
0xe6,
0x99,
0x9f,
0xa8,
0x09,
0x2b};
0xdc,
0x86,
0x9a,
0xa8,
0xa2,
0x07,
0x97,
0xbe,
0x6d,
0xe6,
0x99,
0x9f,
0xa8,
0x09,
0x2b};
/* Calculate a stable "random" number based on the SSID. */
ssid = nm_setting_wireless_get_ssid(s_wifi);

View file

@ -412,8 +412,8 @@ test_ap_wpa_psk_connection_base(const char *key_mgmt,
const char *ssid = "blahblah";
const char *bssid = "01:02:03:04:05:06";
const KeyData exp_wifi[] = {{NM_SETTING_WIRELESS_SSID, ssid, 0},
{NM_SETTING_WIRELESS_MODE, "infrastructure", 0},
{NULL}};
{NM_SETTING_WIRELESS_MODE, "infrastructure", 0},
{NULL}};
const KeyData both_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, key_mgmt, 0},
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, auth_alg, 0},
{NM_SETTING_WIRELESS_SECURITY_PSK, "asdfasdfasdfasdfasdfafs", 0},
@ -541,8 +541,8 @@ test_ap_wpa_eap_connection_base(const char *key_mgmt,
const char *bssid = "01:02:03:04:05:06";
const KeyData src_empty[] = {{NULL}};
const KeyData src_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, key_mgmt, 0},
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, auth_alg, 0},
{NULL}};
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, auth_alg, 0},
{NULL}};
gboolean success;
GError *error = NULL;
@ -778,12 +778,12 @@ test_priv_ap_leap_connection_1(gconstpointer add_wifi)
const char *bssid = "01:02:03:04:05:06";
const char *leap_username = "Bill Smith";
const KeyData src_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", 0},
{NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, leap_username, 0},
{NULL}};
{NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, leap_username, 0},
{NULL}};
const KeyData exp_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", 0},
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "leap", 0},
{NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, leap_username, 0},
{NULL}};
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "leap", 0},
{NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, leap_username, 0},
{NULL}};
gboolean success;
GError *error = NULL;
@ -862,15 +862,15 @@ test_priv_ap_dynamic_wep_1(void)
const char *ssid = "blahblah";
const char *bssid = "01:02:03:04:05:06";
const KeyData src_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", 0},
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0},
{NULL}};
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0},
{NULL}};
const KeyData both_8021x[] = {{NM_SETTING_802_1X_EAP, "peap", 0},
{NM_SETTING_802_1X_IDENTITY, "Bill Smith", 0},
{NM_SETTING_802_1X_PHASE2_AUTH, "mschapv2", 0},
{NULL}};
const KeyData exp_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", 0},
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0},
{NULL}};
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0},
{NULL}};
gboolean success;
GError *error = NULL;
@ -917,8 +917,8 @@ test_priv_ap_dynamic_wep_2(void)
{NM_SETTING_802_1X_PHASE2_AUTH, "mschapv2", 0},
{NULL}};
const KeyData exp_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", 0},
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0},
{NULL}};
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0},
{NULL}};
gboolean success;
GError *error = NULL;
@ -1130,8 +1130,8 @@ test_wpa_ap_leap_connection_1(gconstpointer data)
const char *bssid = "01:02:03:04:05:06";
const char *leap_username = "Bill Smith";
const KeyData src_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", 0},
{NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, leap_username, 0},
{NULL}};
{NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, leap_username, 0},
{NULL}};
gboolean success;
GError *error = NULL;

View file

@ -1520,7 +1520,7 @@ nm_dhcp_client_handle_event(gpointer unused,
nm_auto_unref_l3cd_init NML3ConfigData *l3cd = NULL;
NMDhcpClientEventType client_event_type;
NMPlatformIP6Address prefix = {
0,
0,
};
int IS_IPv4;

View file

@ -593,7 +593,7 @@ nm_dhcp_utils_ip6_prefix_from_options(GHashTable *options)
{
gs_strfreev char **split_addr = NULL;
NMPlatformIP6Address address = {
0,
0,
};
struct in6_addr tmp_addr;
char *str = NULL;

View file

@ -203,8 +203,8 @@ test_parse_search_list(void)
g_strfreev(domains);
data = (guint8[]){0x04, 't', 'e', 's', 't', 0x07, 'e', 'x', 'a', 'm', 'p', 'l',
'e', 0x03, 'c', 'o', 'm', 0x00, 0xc0, 0x05, 0x03, 'a', 'b', 'c',
0xc0, 0x0d, 0x06, 'f', 'o', 'o', 'b', 'a', 'r', 0x00};
'e', 0x03, 'c', 'o', 'm', 0x00, 0xc0, 0x05, 0x03, 'a', 'b', 'c',
0xc0, 0x0d, 0x06, 'f', 'o', 'o', 'b', 'a', 'r', 0x00};
domains = nm_dhcp_lease_data_parse_search_list(data, 34, NULL, 0, 0);
g_assert(domains);
g_assert_cmpint(g_strv_length(domains), ==, 4);
@ -285,7 +285,7 @@ test_classless_static_routes_1(void)
const char *expected_route2_dest = "10.0.0.0";
const char *expected_route2_gw = "10.17.66.41";
static const Option data[] = {
/* dhclient custom format */
/* dhclient custom format */
{"rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 8 10 10 17 66 41"},
{NULL, NULL}};
@ -310,7 +310,7 @@ test_classless_static_routes_2(void)
const char *expected_route2_dest = "10.0.0.0";
const char *expected_route2_gw = "10.17.66.41";
static const Option data[] = {
/* dhcpcd format */
/* dhcpcd format */
{"classless_static_routes", "192.168.10.0/24 192.168.1.1 10.0.0.0/8 10.17.66.41"},
{NULL, NULL}};
@ -336,9 +336,9 @@ test_fedora_dhclient_classless_static_routes(void)
const char *expected_route2_gw = "10.34.255.6";
const char *expected_gateway = "192.168.0.113";
static const Option data[] = {
/* Fedora dhclient format */
/* Fedora dhclient format */
{"classless_static_routes",
"0 192.168.0.113 25.129.210.177.132 192.168.0.113 7.2 10.34.255.6"},
"0 192.168.0.113 25.129.210.177.132 192.168.0.113 7.2 10.34.255.6"},
{NULL, NULL}};
options = fill_table(generic_options, NULL);
@ -362,7 +362,7 @@ test_dhclient_invalid_classless_routes_1(void)
const char *expected_route1_dest = "192.168.10.0";
const char *expected_route1_gw = "192.168.1.1";
static const Option data[] = {
/* dhclient format */
/* dhclient format */
{"rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 45 10 17 66 41"},
{NULL, NULL}};
@ -389,7 +389,7 @@ test_dhcpcd_invalid_classless_routes_1(void)
const char *expected_route2_dest = "100.99.88.56";
const char *expected_route2_gw = "10.1.1.1";
static const Option data[] = {
/* dhcpcd format */
/* dhcpcd format */
{"classless_static_routes", "192.168.10.0/24 192.168.1.1 10.0.adfadf/44 10.17.66.41"},
{NULL, NULL}};
@ -419,8 +419,8 @@ test_dhclient_invalid_classless_routes_2(void)
const char *expected_route2_dest = "100.99.88.56";
const char *expected_route2_gw = "10.1.1.1";
static const Option data[] = {
{"rfc3442_classless_static_routes", "45 10 17 66 41 24 192 168 10 192 168 1 1"},
{NULL, NULL}};
{"rfc3442_classless_static_routes", "45 10 17 66 41 24 192 168 10 192 168 1 1"},
{NULL, NULL}};
options = fill_table(generic_options, NULL);
options = fill_table(data, options);
@ -448,8 +448,8 @@ test_dhcpcd_invalid_classless_routes_2(void)
const char *expected_route2_dest = "100.99.88.56";
const char *expected_route2_gw = "10.1.1.1";
static const Option data[] = {
{"classless_static_routes", "10.0.adfadf/44 10.17.66.41 192.168.10.0/24 192.168.1.1"},
{NULL, NULL}};
{"classless_static_routes", "10.0.adfadf/44 10.17.66.41 192.168.10.0/24 192.168.1.1"},
{NULL, NULL}};
options = fill_table(generic_options, NULL);
options = fill_table(data, options);
@ -477,8 +477,8 @@ test_dhclient_invalid_classless_routes_3(void)
const char *expected_route1_dest = "192.168.10.0";
const char *expected_route1_gw = "192.168.1.1";
static const Option data[] = {
{"rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 32 128 10 17 66 41"},
{NULL, NULL}};
{"rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 32 128 10 17 66 41"},
{NULL, NULL}};
options = fill_table(generic_options, NULL);
options = fill_table(data, options);
@ -501,8 +501,8 @@ test_dhcpcd_invalid_classless_routes_3(void)
const char *expected_route1_dest = "192.168.10.0";
const char *expected_route1_gw = "192.168.1.1";
static Option data[] = {
{"classless_static_routes", "192.168.10.0/24 192.168.1.1 128/32 10.17.66.41"},
{NULL, NULL}};
{"classless_static_routes", "192.168.10.0/24 192.168.1.1 128/32 10.17.66.41"},
{NULL, NULL}};
options = fill_table(generic_options, NULL);
options = fill_table(data, options);
@ -526,8 +526,8 @@ test_dhclient_gw_in_classless_routes(void)
const char *expected_route1_gw = "192.168.1.1";
const char *expected_gateway = "192.2.3.4";
static Option data[] = {
{"rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 0 192 2 3 4"},
{NULL, NULL}};
{"rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 0 192 2 3 4"},
{NULL, NULL}};
options = fill_table(generic_options, NULL);
options = fill_table(data, options);
@ -550,8 +550,8 @@ test_dhcpcd_gw_in_classless_routes(void)
const char *expected_route1_gw = "192.168.1.1";
const char *expected_gateway = "192.2.3.4";
static Option data[] = {
{"classless_static_routes", "192.168.10.0/24 192.168.1.1 0.0.0.0/0 192.2.3.4"},
{NULL, NULL}};
{"classless_static_routes", "192.168.10.0/24 192.168.1.1 0.0.0.0/0 192.2.3.4"},
{NULL, NULL}};
options = fill_table(generic_options, NULL);
options = fill_table(data, options);

View file

@ -575,93 +575,93 @@ nm_config_cmd_line_options_add_to_entries(NMConfigCmdLineOptions *cli, GOptionCo
{
GOptionGroup *group;
GOptionEntry config_options[] = {
{"config",
0,
0,
G_OPTION_ARG_FILENAME,
&cli->config_main_file,
N_("Config file location"),
DEFAULT_CONFIG_MAIN_FILE},
{"config-dir",
0,
0,
G_OPTION_ARG_FILENAME,
&cli->config_dir,
N_("Config directory location"),
DEFAULT_CONFIG_DIR},
{"system-config-dir",
0,
0,
G_OPTION_ARG_FILENAME,
&cli->system_config_dir,
N_("System config directory location"),
DEFAULT_SYSTEM_CONFIG_DIR},
{"intern-config",
0,
0,
G_OPTION_ARG_FILENAME,
&cli->intern_config_file,
N_("Internal config file location"),
DEFAULT_INTERN_CONFIG_FILE},
{"state-file",
0,
0,
G_OPTION_ARG_FILENAME,
&cli->state_file,
N_("State file location"),
DEFAULT_STATE_FILE},
{"no-auto-default",
0,
G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_FILENAME,
&cli->no_auto_default_file,
N_("State file for no-auto-default devices"),
DEFAULT_NO_AUTO_DEFAULT_FILE},
{"plugins",
0,
0,
G_OPTION_ARG_STRING,
&cli->plugins,
N_("List of plugins separated by ','"),
NM_CONFIG_DEFAULT_MAIN_PLUGINS},
{"configure-and-quit",
0,
G_OPTION_FLAG_OPTIONAL_ARG,
G_OPTION_ARG_CALLBACK,
parse_configure_and_quit,
N_("Quit after initial configuration"),
NULL},
{"debug",
'd',
0,
G_OPTION_ARG_NONE,
&cli->is_debug,
N_("Don't become a daemon, and log to stderr"),
NULL},
{"config",
0,
0,
G_OPTION_ARG_FILENAME,
&cli->config_main_file,
N_("Config file location"),
DEFAULT_CONFIG_MAIN_FILE},
{"config-dir",
0,
0,
G_OPTION_ARG_FILENAME,
&cli->config_dir,
N_("Config directory location"),
DEFAULT_CONFIG_DIR},
{"system-config-dir",
0,
0,
G_OPTION_ARG_FILENAME,
&cli->system_config_dir,
N_("System config directory location"),
DEFAULT_SYSTEM_CONFIG_DIR},
{"intern-config",
0,
0,
G_OPTION_ARG_FILENAME,
&cli->intern_config_file,
N_("Internal config file location"),
DEFAULT_INTERN_CONFIG_FILE},
{"state-file",
0,
0,
G_OPTION_ARG_FILENAME,
&cli->state_file,
N_("State file location"),
DEFAULT_STATE_FILE},
{"no-auto-default",
0,
G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_FILENAME,
&cli->no_auto_default_file,
N_("State file for no-auto-default devices"),
DEFAULT_NO_AUTO_DEFAULT_FILE},
{"plugins",
0,
0,
G_OPTION_ARG_STRING,
&cli->plugins,
N_("List of plugins separated by ','"),
NM_CONFIG_DEFAULT_MAIN_PLUGINS},
{"configure-and-quit",
0,
G_OPTION_FLAG_OPTIONAL_ARG,
G_OPTION_ARG_CALLBACK,
parse_configure_and_quit,
N_("Quit after initial configuration"),
NULL},
{"debug",
'd',
0,
G_OPTION_ARG_NONE,
&cli->is_debug,
N_("Don't become a daemon, and log to stderr"),
NULL},
/* These three are hidden for now, and should eventually just go away. */
{"connectivity-uri",
0,
G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_STRING,
&cli->connectivity_uri,
N_("An http(s) address for checking internet connectivity"),
"http://example.com"},
{"connectivity-interval",
0,
G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_INT,
&cli->connectivity_interval,
N_("The interval between connectivity checks (in seconds)"),
G_STRINGIFY(NM_CONFIG_DEFAULT_CONNECTIVITY_INTERVAL)},
{"connectivity-response",
0,
G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_STRING,
&cli->connectivity_response,
N_("The expected start of the response"),
NM_CONFIG_DEFAULT_CONNECTIVITY_RESPONSE},
{0},
/* These three are hidden for now, and should eventually just go away. */
{"connectivity-uri",
0,
G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_STRING,
&cli->connectivity_uri,
N_("An http(s) address for checking internet connectivity"),
"http://example.com"},
{"connectivity-interval",
0,
G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_INT,
&cli->connectivity_interval,
N_("The interval between connectivity checks (in seconds)"),
G_STRINGIFY(NM_CONFIG_DEFAULT_CONNECTIVITY_INTERVAL)},
{"connectivity-response",
0,
G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_STRING,
&cli->connectivity_response,
N_("The expected start of the response"),
NM_CONFIG_DEFAULT_CONNECTIVITY_RESPONSE},
{0},
};
g_return_if_fail(opt_ctx);

View file

@ -2996,10 +2996,10 @@ nm_l3_config_data_merge(NML3ConfigData *self,
gpointer hook_user_data)
{
static const guint32 x_default_route_metric_x[2] = {NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP6,
NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP4};
NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP4};
static const guint32 x_default_route_penalty_x[2] = {0, 0};
static const int x_default_dns_priority_x[2] = {NM_DNS_PRIORITY_DEFAULT_NORMAL,
NM_DNS_PRIORITY_DEFAULT_NORMAL};
NM_DNS_PRIORITY_DEFAULT_NORMAL};
guint32 default_route_table_coerced_x[2];
NMDedupMultiIter iter;
const NMPObject *obj;

View file

@ -25,14 +25,14 @@ read_argv(int *argc, char ***argv)
{
GOptionContext *context;
GOptionEntry options[] = {
{"no-persist",
'P',
G_OPTION_FLAG_REVERSE,
G_OPTION_ARG_NONE,
&global_opt.persist,
"Exit after processing netlink messages",
NULL},
{0},
{"no-persist",
'P',
G_OPTION_FLAG_REVERSE,
G_OPTION_ARG_NONE,
&global_opt.persist,
"Exit after processing netlink messages",
NULL},
{0},
};
gs_free_error GError *error = NULL;

View file

@ -1938,10 +1938,10 @@ nmtstp_link_macvlan_add(NMPlatform *platform,
if (external_command) {
const char *dev;
char *modes[] = {
[MACVLAN_MODE_BRIDGE] = "bridge",
[MACVLAN_MODE_VEPA] = "vepa",
[MACVLAN_MODE_PRIVATE] = "private",
[MACVLAN_MODE_PASSTHRU] = "passthru",
[MACVLAN_MODE_BRIDGE] = "bridge",
[MACVLAN_MODE_VEPA] = "vepa",
[MACVLAN_MODE_PRIVATE] = "private",
[MACVLAN_MODE_PASSTHRU] = "passthru",
};
dev = nm_platform_link_get_name(platform, parent);

View file

@ -853,7 +853,7 @@ static void
_test_wireguard_change(NMPlatform *platform, int ifindex, int test_mode)
{
const KeyPair self_key = {"yOWEsaXFxX9/DOkQPzqB9RufZOpfSP4LZZCErP0N0Xo=",
"s6pVT2xPwktor9O5bVOSzcPqBu9uzQOUzPQHXLU2jmk="};
"s6pVT2xPwktor9O5bVOSzcPqBu9uzQOUzPQHXLU2jmk="};
const KeyPair keys[100] = {
{"+BDHMh11bkheGfvlQpqt8P/H7N1sPXtVi05XraZS0E8=",
"QItu7PJadBVXFXGv55CMtVnbRHdrI6E2CGlu2N5oGx4=",

View file

@ -1171,7 +1171,7 @@ _rule_check_kernel_support(NMPlatform *platform, int attribute)
.addr_family = AF_INET,
.priority = PROBE_PRORITY,
.uid_range =
{
{
.start = 0,
.end = 0,
},

View file

@ -668,8 +668,8 @@ test_read_miscellaneous_variables(void)
NMSettingWired *s_wired;
NMSettingIPConfig *s_ip4;
char *expected_mac_blacklist[3] = {"00:16:41:11:22:88",
"00:16:41:11:22:99",
"6a:5d:5a:fa:dd:f0"};
"00:16:41:11:22:99",
"6a:5d:5a:fa:dd:f0"};
int mac_blacklist_num, i;
guint64 expected_timestamp = 0;
@ -2030,17 +2030,17 @@ test_read_wired_aliases_good(gconstpointer test_data)
NMSettingIPConfig *s_ip4;
int expected_num_addresses;
const char *expected_address_0[] = {"192.168.1.5",
"192.168.1.6",
"192.168.1.9",
"192.168.1.99",
NULL};
"192.168.1.6",
"192.168.1.9",
"192.168.1.99",
NULL};
const char *expected_address_3[] = {"192.168.1.5", "192.168.1.6", NULL};
const char *expected_label_0[] = {
NULL,
"aliasem0:1",
"aliasem0:2",
"aliasem0:99",
NULL,
NULL,
"aliasem0:1",
"aliasem0:2",
"aliasem0:99",
NULL,
};
const char *expected_label_3[] = {
NULL,
@ -8189,8 +8189,8 @@ test_read_infiniband(void)
char *unmanaged = NULL;
const char *mac;
char expected_mac_address[INFINIBAND_ALEN] = {0x80, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc,
0xdd, 0xee, 0xff, 0x00, 0x11, 0x22};
0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc,
0xdd, 0xee, 0xff, 0x00, 0x11, 0x22};
const char *transport_mode;
connection = _connection_from_file(TEST_IFCFG_DIR "/ifcfg-test-infiniband",

View file

@ -1805,8 +1805,8 @@ test_read_infiniband_connection(void)
NMSettingInfiniband *s_ib;
const char *mac;
guint8 expected_mac[INFINIBAND_ALEN] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66,
0x77, 0x88, 0x99, 0x01, 0x12, 0x23, 0x34,
0x45, 0x56, 0x67, 0x78, 0x89, 0x90};
0x77, 0x88, 0x99, 0x01, 0x12, 0x23, 0x34,
0x45, 0x56, 0x67, 0x78, 0x89, 0x90};
const char *expected_id = "Test InfiniBand Connection";
const char *expected_uuid = "4e80a56d-c99f-4aad-a6dd-b449bc398c57";

View file

@ -1103,9 +1103,9 @@ test_config_set_values(void)
const char *CONFIG_USER = BUILD_DIR "/test-set-values-user.conf";
const char *CONFIG_INTERN = BUILD_DIR "/test-set-values-intern.conf";
const char *atomic_section_prefixes[] = {
"atomic-prefix-1.",
"atomic-prefix-2.",
NULL,
"atomic-prefix-1.",
"atomic-prefix-2.",
NULL,
};
g_assert(g_file_set_contents(CONFIG_USER, "", 0, NULL));

View file

@ -227,11 +227,11 @@ do_test_nm_utils_kill_child(void)
{
GLogLevelFlags fatal_mask;
char *argv_watchdog[] = {
"bash",
"-c",
"sleep 4; "
"kill -KILL 0; #watchdog for #" TEST_TOKEN,
NULL,
"bash",
"-c",
"sleep 4; "
"kill -KILL 0; #watchdog for #" TEST_TOKEN,
NULL,
};
char *argv1[] = {
"bash",

View file

@ -2353,21 +2353,21 @@ test_nm_utils_dhcp_client_id_systemd_node_specific(gconstpointer test_data)
{
const int TEST_IDX = GPOINTER_TO_INT(test_data);
const guint8 HASH_KEY[16] = {0x80,
0x11,
0x8c,
0xc2,
0xfe,
0x4a,
0x03,
0xee,
0x3e,
0xd6,
0x0c,
0x6f,
0x36,
0x39,
0x14,
0x09};
0x11,
0x8c,
0xc2,
0xfe,
0x4a,
0x03,
0xee,
0x3e,
0xd6,
0x0c,
0x6f,
0x36,
0x39,
0x14,
0x09};
const guint16 duid_type_en = htons(2);
const guint32 systemd_pen = htonl(43793);
const struct {

View file

@ -825,10 +825,10 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
{
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE(setting);
const char *valid_modes[] = {NM_SETTING_WIRELESS_MODE_INFRA,
NM_SETTING_WIRELESS_MODE_ADHOC,
NM_SETTING_WIRELESS_MODE_AP,
NM_SETTING_WIRELESS_MODE_MESH,
NULL};
NM_SETTING_WIRELESS_MODE_ADHOC,
NM_SETTING_WIRELESS_MODE_AP,
NM_SETTING_WIRELESS_MODE_MESH,
NULL};
const char *valid_bands[] = {"a", "bg", NULL};
guint i;
gsize length;

View file

@ -2148,11 +2148,11 @@ nm_team_setting_config_set(NMTeamSetting *self, const char *js_str)
else {
gboolean unrecognized_content = FALSE;
bool has_lst[_NM_TEAM_ATTRIBUTE_NUM] = {
FALSE,
FALSE,
};
NMValueTypUnion val_lst[_NM_TEAM_ATTRIBUTE_NUM];
nm_json_t *found_keys[_NM_TEAM_ATTRIBUTE_NUM] = {
NULL,
NULL,
};
gs_unref_ptrarray GPtrArray *ptr_array_master_runner_tx_hash_free = NULL;
gs_unref_ptrarray GPtrArray *ptr_array_link_watchers_free = NULL;

View file

@ -3928,11 +3928,11 @@ test_connection_diff_different(void)
NMSettingIPConfig *s_ip4;
gboolean same;
const DiffSetting settings[] = {
{NM_SETTING_IP4_CONFIG_SETTING_NAME,
{
{NM_SETTING_IP_CONFIG_METHOD,
NM_SETTING_DIFF_RESULT_IN_A | NM_SETTING_DIFF_RESULT_IN_B},
{NULL, NM_SETTING_DIFF_RESULT_UNKNOWN},
{NM_SETTING_IP4_CONFIG_SETTING_NAME,
{
{NM_SETTING_IP_CONFIG_METHOD,
NM_SETTING_DIFF_RESULT_IN_A | NM_SETTING_DIFF_RESULT_IN_B},
{NULL, NM_SETTING_DIFF_RESULT_UNKNOWN},
}},
};
@ -4013,10 +4013,10 @@ test_connection_diff_inferrable(void)
NMSettingIPConfig *s_ip4;
char *uuid;
const DiffSetting settings[] = {
{NM_SETTING_CONNECTION_SETTING_NAME,
{
{NM_SETTING_CONNECTION_INTERFACE_NAME, NM_SETTING_DIFF_RESULT_IN_A},
{NULL, NM_SETTING_DIFF_RESULT_UNKNOWN},
{NM_SETTING_CONNECTION_SETTING_NAME,
{
{NM_SETTING_CONNECTION_INTERFACE_NAME, NM_SETTING_DIFF_RESULT_IN_A},
{NULL, NM_SETTING_DIFF_RESULT_UNKNOWN},
}},
};
@ -6736,53 +6736,53 @@ test_setting_ip6_gateway(void)
GVariant *gateway_var;
GVariantBuilder addrs_builder;
guint8 addr_bytes_0[] = {0xab,
0xcd,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x0a};
0xcd,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x0a};
guint8 addr_bytes_1[] = {0xab,
0xcd,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x0b};
0xcd,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x0b};
guint8 gateway_bytes_1[] = {0xab,
0xcd,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x01};
0xcd,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x01};
GError *error = NULL;
/* When serializing on the daemon side, ipv6.gateway is copied to the first

View file

@ -117,8 +117,8 @@ test_make_strv(void)
const char *const *v2a = NM_MAKE_STRV("a", "b");
const char *const *v2b = NM_MAKE_STRV("a", "b", );
const char *const v3[] = {
"a",
"b",
"a",
"b",
};
const char *const *v4b = NM_MAKE_STRV("a", _make_strv_foo(), );

View file

@ -5169,7 +5169,7 @@ _nl_msg_new_tfilter(int nlmsg_type, int nlmsg_flags, const NMPlatformTfilter *tf
if (nm_streq(action->kind, NM_PLATFORM_ACTION_KIND_SIMPLE)) {
const NMPlatformActionSimple *simple = &action->simple;
struct tc_defact sel = {
0,
0,
};
if (!(act_options = nla_nest_start(msg, TCA_ACT_OPTIONS)))
@ -5183,7 +5183,7 @@ _nl_msg_new_tfilter(int nlmsg_type, int nlmsg_flags, const NMPlatformTfilter *tf
} else if (nm_streq(action->kind, NM_PLATFORM_ACTION_KIND_MIRRED)) {
const NMPlatformActionMirred *mirred = &action->mirred;
struct tc_mirred sel = {
0,
0,
};
if (!(act_options = nla_nest_start(msg, TCA_ACT_OPTIONS)))
@ -7767,7 +7767,7 @@ link_set_address(NMPlatform *platform, int ifindex, gconstpointer address, size_
nm_auto_nlmsg struct nl_msg *nlmsg = NULL;
const ChangeLinkData d = {
.set_address =
{
{
.address = address,
.length = length,
},

View file

@ -199,13 +199,13 @@ nm_vpn_openconnect_authenticate_helper(const char *host,
const char *const *iter;
const char *path;
const char *const DEFAULT_PATHS[] = {
"/sbin/",
"/usr/sbin/",
"/usr/local/sbin/",
"/bin/",
"/usr/bin/",
"/usr/local/bin/",
NULL,
"/sbin/",
"/usr/sbin/",
"/usr/local/sbin/",
"/bin/",
"/usr/bin/",
"/usr/local/bin/",
NULL,
};
path = nm_utils_file_search_in_paths("openconnect",

View file

@ -1138,25 +1138,25 @@ _initial_setup(int *p_argc, char ***p_argv, GError **error)
GOptionContext *opt_ctx;
gboolean arg_debug = FALSE;
GOptionEntry entries[] = {{
"debug",
0,
0,
G_OPTION_ARG_NONE,
&arg_debug,
"Output to console rather than syslog",
NULL,
"debug",
0,
0,
G_OPTION_ARG_NONE,
&arg_debug,
"Output to console rather than syslog",
NULL,
},
{
"persist",
0,
0,
G_OPTION_ARG_NONE,
&gl.persist,
"Don't quit after a short timeout",
NULL,
{
"persist",
0,
0,
G_OPTION_ARG_NONE,
&gl.persist,
"Don't quit after a short timeout",
NULL,
},
{
NULL,
{
NULL,
}};
gboolean success;

View file

@ -103,50 +103,50 @@ main(int argc, char *argv[])
gboolean dump_to_stdout = FALSE;
gs_strfreev char **remaining = NULL;
GOptionEntry option_entries[] = {
{"connections-dir",
'c',
0,
G_OPTION_ARG_FILENAME,
&connections_dir,
"Output connection directory",
NM_KEYFILE_PATH_NAME_RUN},
{"persistent-connections-dir",
'p',
0,
G_OPTION_ARG_FILENAME,
&etc_connections_dir,
"Persistent connection directory",
NM_KEYFILE_PATH_NAME_ETC_DEFAULT},
{"initrd-data-dir",
'i',
0,
G_OPTION_ARG_FILENAME,
&initrd_dir,
"Output initrd data directory",
DEFAULT_INITRD_DATA_DIR},
{"sysfs-dir",
'd',
0,
G_OPTION_ARG_FILENAME,
&sysfs_dir,
"The sysfs mount point",
DEFAULT_SYSFS_DIR},
{"run-config-dir",
'r',
0,
G_OPTION_ARG_FILENAME,
&run_config_dir,
"Output config directory",
DEFAULT_RUN_CONFIG_DIR},
{"stdout",
's',
0,
G_OPTION_ARG_NONE,
&dump_to_stdout,
"Dump connections to standard output",
NULL},
{G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &remaining, NULL, NULL},
{NULL}};
{"connections-dir",
'c',
0,
G_OPTION_ARG_FILENAME,
&connections_dir,
"Output connection directory",
NM_KEYFILE_PATH_NAME_RUN},
{"persistent-connections-dir",
'p',
0,
G_OPTION_ARG_FILENAME,
&etc_connections_dir,
"Persistent connection directory",
NM_KEYFILE_PATH_NAME_ETC_DEFAULT},
{"initrd-data-dir",
'i',
0,
G_OPTION_ARG_FILENAME,
&initrd_dir,
"Output initrd data directory",
DEFAULT_INITRD_DATA_DIR},
{"sysfs-dir",
'd',
0,
G_OPTION_ARG_FILENAME,
&sysfs_dir,
"The sysfs mount point",
DEFAULT_SYSFS_DIR},
{"run-config-dir",
'r',
0,
G_OPTION_ARG_FILENAME,
&run_config_dir,
"Output config directory",
DEFAULT_RUN_CONFIG_DIR},
{"stdout",
's',
0,
G_OPTION_ARG_NONE,
&dump_to_stdout,
"Dump connections to standard output",
NULL},
{G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &remaining, NULL, NULL},
{NULL}};
nm_auto_free_option_context GOptionContext *option_context = NULL;
gs_free_error GError *error = NULL;
gs_free char *hostname = NULL;

View file

@ -534,8 +534,8 @@ reader_parse_ip(Reader *reader, const char *sysfs_dir, char *argument)
int client_ip_prefix = -1;
gboolean clear_ip4_required_timeout = TRUE;
const char *dns[2] = {
NULL,
NULL,
NULL,
NULL,
};
int dns_addr_family[2] = {
AF_UNSPEC,

View file

@ -233,30 +233,30 @@ main(int argc, char *argv[])
GOptionContext *opt_ctx = NULL;
gboolean success;
GOptionEntry options[] = {
{"quiet", 'q', 0, G_OPTION_ARG_NONE, &data.quiet, N_("Don't print anything"), NULL},
{"wait-for-startup",
's',
0,
G_OPTION_ARG_NONE,
&data.wait_startup,
N_("Wait for NetworkManager startup instead of a connection"),
NULL},
{"timeout",
't',
0,
G_OPTION_ARG_INT,
&t_secs,
N_("Time to wait for a connection, in seconds (without the option, default value is 30). "
{"quiet", 'q', 0, G_OPTION_ARG_NONE, &data.quiet, N_("Don't print anything"), NULL},
{"wait-for-startup",
's',
0,
G_OPTION_ARG_NONE,
&data.wait_startup,
N_("Wait for NetworkManager startup instead of a connection"),
NULL},
{"timeout",
't',
0,
G_OPTION_ARG_INT,
&t_secs,
N_("Time to wait for a connection, in seconds (without the option, default value is 30). "
"Maximum value is 2073600 seconds."),
"<timeout>"},
{"exit",
'x',
0,
G_OPTION_ARG_NONE,
&data.exit_no_nm,
N_("Exit immediately if NetworkManager is not running or connecting"),
NULL},
{NULL},
"<timeout>"},
{"exit",
'x',
0,
G_OPTION_ARG_NONE,
&data.exit_no_nm,
N_("Exit immediately if NetworkManager is not running or connecting"),
NULL},
{NULL},
};
/* Set locale to be able to use environment variables */

View file

@ -1014,7 +1014,7 @@ nmc_readline_echo(const NmcConfig *nmc_config, gboolean echo_on, const char *pro
#if HAVE_READLINE_HISTORY
nm_auto_free HISTORY_STATE *saved_history = NULL;
HISTORY_STATE passwd_history = {
0,
0,
};
#else
int start, curpos;

View file

@ -8905,12 +8905,12 @@ do_connection_edit(const NMCCommand *cmd, NmCli *nmc, int argc, const char *cons
gs_free_error GError *error = NULL;
GError *err1 = NULL;
nmc_arg_t exp_args[] = {{"type", TRUE, &type, FALSE},
{"con-name", TRUE, &con_name, FALSE},
{"id", TRUE, &con_id, FALSE},
{"uuid", TRUE, &con_uuid, FALSE},
{"path", TRUE, &con_path, FALSE},
{"filename", TRUE, &con_filename, FALSE},
{NULL}};
{"con-name", TRUE, &con_name, FALSE},
{"id", TRUE, &con_id, FALSE},
{"uuid", TRUE, &con_uuid, FALSE},
{"path", TRUE, &con_path, FALSE},
{"filename", TRUE, &con_filename, FALSE},
{NULL}};
next_arg(nmc, &argc, &argv, NULL);
if (argc == 1 && nmc->complete)

View file

@ -92,18 +92,18 @@ nmt_connect_device_free(NmtConnectDevice *nmtdev)
}
static const char *device_sort_order[] = {"NMDeviceEthernet",
"NMDeviceVeth",
"NMDeviceInfiniband",
"NMDeviceWifi",
NM_SETTING_VLAN_SETTING_NAME,
NM_SETTING_BOND_SETTING_NAME,
NM_SETTING_TEAM_SETTING_NAME,
NM_SETTING_BRIDGE_SETTING_NAME,
NM_SETTING_IP_TUNNEL_SETTING_NAME,
NM_SETTING_WIREGUARD_SETTING_NAME,
NM_SETTING_TUN_SETTING_NAME,
"NMDeviceModem",
"NMDeviceBt"};
"NMDeviceVeth",
"NMDeviceInfiniband",
"NMDeviceWifi",
NM_SETTING_VLAN_SETTING_NAME,
NM_SETTING_BOND_SETTING_NAME,
NM_SETTING_TEAM_SETTING_NAME,
NM_SETTING_BRIDGE_SETTING_NAME,
NM_SETTING_IP_TUNNEL_SETTING_NAME,
NM_SETTING_WIREGUARD_SETTING_NAME,
NM_SETTING_TUN_SETTING_NAME,
"NMDeviceModem",
"NMDeviceBt"};
static const int device_sort_order_len = G_N_ELEMENTS(device_sort_order);
static int