mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-23 21:20:41 +01:00
all: get rid of a handful of unused-but-set variables
This commit is contained in:
parent
0ae44fe7e2
commit
6672c5e92e
35 changed files with 40 additions and 145 deletions
|
|
@ -1094,7 +1094,6 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
|
|||
const char *fields_str = NULL;
|
||||
const NMMetaAbstractInfo *const*tmpl;
|
||||
NmcOutputField *arr;
|
||||
size_t tmpl_len;
|
||||
const char *base_hdr = _("Activate connection details");
|
||||
gboolean was_output = FALSE;
|
||||
|
||||
|
|
@ -1148,7 +1147,6 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
|
|||
|
||||
/* Add field names */
|
||||
tmpl = (const NMMetaAbstractInfo *const*) nmc_fields_con_active_details_general;
|
||||
tmpl_len = sizeof (nmc_fields_con_active_details_general);
|
||||
out_indices = parse_output_fields (group_fld,
|
||||
tmpl, FALSE, NULL, NULL);
|
||||
arr = nmc_dup_fields_array (tmpl, NMC_OF_FLAG_FIELD_NAMES);
|
||||
|
|
|
|||
|
|
@ -471,10 +471,6 @@ request_secrets_from_ui (NMSecretAgentSimpleRequest *request)
|
|||
|
||||
ok = add_wireless_secrets (request, secrets);
|
||||
} else if (nm_connection_is_type (request->connection, NM_SETTING_WIRED_SETTING_NAME)) {
|
||||
NMSettingConnection *s_con;
|
||||
|
||||
s_con = nm_connection_get_setting_connection (request->connection);
|
||||
|
||||
title = _("Wired 802.1X authentication");
|
||||
msg = g_strdup_printf (_("Secrets are required to access the wired network '%s'"),
|
||||
nm_connection_get_id (request->connection));
|
||||
|
|
@ -567,10 +563,6 @@ request_secrets_from_ui (NMSecretAgentSimpleRequest *request)
|
|||
} else
|
||||
ok = FALSE;
|
||||
} else if (nm_connection_is_type (request->connection, NM_SETTING_VPN_SETTING_NAME)) {
|
||||
NMSettingConnection *s_con;
|
||||
|
||||
s_con = nm_connection_get_setting_connection (request->connection);
|
||||
|
||||
title = _("VPN password required");
|
||||
msg = NULL;
|
||||
|
||||
|
|
@ -612,8 +604,6 @@ nm_secret_agent_simple_get_secrets (NMSecretAgentOld *agent,
|
|||
NMSecretAgentSimple *self = NM_SECRET_AGENT_SIMPLE (agent);
|
||||
NMSecretAgentSimplePrivate *priv = NM_SECRET_AGENT_SIMPLE_GET_PRIVATE (self);
|
||||
NMSecretAgentSimpleRequest *request;
|
||||
NMSettingConnection *s_con;
|
||||
const char *connection_type;
|
||||
char *request_id;
|
||||
GError *error;
|
||||
|
||||
|
|
@ -629,9 +619,6 @@ nm_secret_agent_simple_get_secrets (NMSecretAgentOld *agent,
|
|||
return;
|
||||
}
|
||||
|
||||
s_con = nm_connection_get_setting_connection (connection);
|
||||
connection_type = nm_setting_connection_get_connection_type (s_con);
|
||||
|
||||
if (!(flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_ALLOW_INTERACTION)) {
|
||||
/* We don't do stored passwords */
|
||||
error = g_error_new (NM_SECRET_AGENT_ERROR, NM_SECRET_AGENT_ERROR_NO_SECRETS,
|
||||
|
|
|
|||
|
|
@ -163,12 +163,10 @@ remove_route (NmtWidgetList *list,
|
|||
gpointer table)
|
||||
{
|
||||
NmtRouteTablePrivate *priv = NMT_ROUTE_TABLE_GET_PRIVATE (table);
|
||||
NMIPRoute *route;
|
||||
|
||||
if (num >= priv->routes->len)
|
||||
return;
|
||||
|
||||
route = priv->routes->pdata[num];
|
||||
g_ptr_array_remove_index (priv->routes, num);
|
||||
nmt_widget_list_set_length (list, priv->routes->len);
|
||||
|
||||
|
|
|
|||
|
|
@ -147,16 +147,12 @@ static gboolean
|
|||
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMSettingMacvlanPrivate *priv = NM_SETTING_MACVLAN_GET_PRIVATE (setting);
|
||||
NMSettingConnection *s_con;
|
||||
NMSettingWired *s_wired;
|
||||
|
||||
if (connection) {
|
||||
s_con = nm_connection_get_setting_connection (connection);
|
||||
if (connection)
|
||||
s_wired = nm_connection_get_setting_wired (connection);
|
||||
} else {
|
||||
s_con = NULL;
|
||||
else
|
||||
s_wired = NULL;
|
||||
}
|
||||
|
||||
if (priv->parent) {
|
||||
if ( !nm_utils_is_uuid (priv->parent)
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ static int
|
|||
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMSettingOvsPatch *self = NM_SETTING_OVS_PATCH (setting);
|
||||
int family = AF_UNSPEC;
|
||||
|
||||
if (!_nm_connection_verify_required_interface_name (connection, error))
|
||||
return FALSE;
|
||||
|
|
@ -99,11 +98,8 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (nm_utils_ipaddr_valid (AF_INET, self->peer))
|
||||
family = AF_INET;
|
||||
else if (nm_utils_ipaddr_valid (AF_INET6, self->peer))
|
||||
family = AF_INET6;
|
||||
else {
|
||||
if ( !nm_utils_ipaddr_valid (AF_INET, self->peer)
|
||||
&& !nm_utils_ipaddr_valid (AF_INET6, self->peer)) {
|
||||
g_set_error (error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
|
|
|
|||
|
|
@ -4616,9 +4616,6 @@ _nm_utils_strstrdictkey_hash (gconstpointer a)
|
|||
|
||||
nm_hash_update_val (&h, k->type);
|
||||
if (k->type & STRSTRDICTKEY_ALL_SET) {
|
||||
gsize n;
|
||||
|
||||
n = 0;
|
||||
p = strchr (k->data, '\0');
|
||||
if (k->type == STRSTRDICTKEY_ALL_SET) {
|
||||
/* the key contains two strings. Continue... */
|
||||
|
|
|
|||
|
|
@ -2436,6 +2436,7 @@ test_setting_connection_permissions_property (void)
|
|||
|
||||
/* Ensure a valid call results in success */
|
||||
success = nm_setting_connection_add_permission (s_con, "user", TEST_UNAME, NULL);
|
||||
g_assert (success);
|
||||
g_assert_cmpint (nm_setting_connection_get_num_permissions (s_con), ==, 1);
|
||||
|
||||
check_permission (s_con, 0, TEST_UNAME);
|
||||
|
|
|
|||
|
|
@ -1024,6 +1024,7 @@ test_setting_connection_permissions_property (void)
|
|||
|
||||
/* Ensure a valid call results in success */
|
||||
success = nm_setting_connection_add_permission (s_con, "user", TEST_UNAME, NULL);
|
||||
g_assert (success);
|
||||
g_assert_cmpint (nm_setting_connection_get_num_permissions (s_con), ==, 1);
|
||||
|
||||
check_permission (s_con, 0, TEST_UNAME);
|
||||
|
|
|
|||
|
|
@ -603,12 +603,10 @@ reg_request_cb (GObject *proxy,
|
|||
{
|
||||
GSimpleAsyncResult *simple = user_data;
|
||||
NMSecretAgentOld *self;
|
||||
NMSecretAgentOldPrivate *priv;
|
||||
GError *error = NULL;
|
||||
|
||||
self = NM_SECRET_AGENT_OLD (g_async_result_get_source_object (G_ASYNC_RESULT (simple)));
|
||||
g_object_unref (self); /* drop extra ref added by get_source_object() */
|
||||
priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
|
||||
|
||||
if (!nmdbus_agent_manager_call_register_finish (NMDBUS_AGENT_MANAGER (proxy), result, &error))
|
||||
g_dbus_error_strip_remote_error (error);
|
||||
|
|
|
|||
|
|
@ -192,13 +192,11 @@ nm_vpn_service_plugin_failure (NMVpnServicePlugin *plugin,
|
|||
gboolean
|
||||
nm_vpn_service_plugin_disconnect (NMVpnServicePlugin *plugin, GError **err)
|
||||
{
|
||||
NMVpnServicePluginPrivate *priv;
|
||||
gboolean ret = FALSE;
|
||||
NMVpnServiceState state;
|
||||
|
||||
g_return_val_if_fail (NM_IS_VPN_SERVICE_PLUGIN (plugin), FALSE);
|
||||
|
||||
priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin);
|
||||
state = nm_vpn_service_plugin_get_state (plugin);
|
||||
switch (state) {
|
||||
case NM_VPN_SERVICE_STATE_STOPPING:
|
||||
|
|
|
|||
|
|
@ -349,10 +349,9 @@ connection_activated_none_cb (GObject *c,
|
|||
gpointer user_data)
|
||||
{
|
||||
TestSecretAgentData *sadata = user_data;
|
||||
NMActiveConnection *ac;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
ac = nm_client_activate_connection_finish (sadata->client, result, &error);
|
||||
nm_client_activate_connection_finish (sadata->client, result, &error);
|
||||
g_assert_error (error, NM_AGENT_MANAGER_ERROR, NM_AGENT_MANAGER_ERROR_NO_SECRETS);
|
||||
|
||||
g_main_loop_quit (sadata->loop);
|
||||
|
|
|
|||
|
|
@ -424,6 +424,11 @@ __nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_
|
|||
g_array_append_val (debug_messages, msg);
|
||||
}
|
||||
} else {
|
||||
/* We're intentionally assigning a value to static variables
|
||||
* s_tests_x and p_tests_x without using it afterwards, just
|
||||
* so that valgrind doesn't complain about the leak. */
|
||||
NM_PRAGMA_WARNING_DISABLE("-Wunused-but-set-variable")
|
||||
|
||||
/* g_test_init() is a variadic function, so we cannot pass it
|
||||
* (variadic) arguments. If you need to pass additional parameters,
|
||||
* call nmtst_init() with argc==NULL and call g_test_init() yourself. */
|
||||
|
|
@ -497,6 +502,8 @@ __nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_
|
|||
s_tests = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
NM_PRAGMA_WARNING_REENABLE
|
||||
}
|
||||
|
||||
if (test_quick_set)
|
||||
|
|
@ -1499,13 +1506,12 @@ _nmtst_connection_normalize (NMConnection *connection, ...)
|
|||
static inline NMConnection *
|
||||
_nmtst_connection_duplicate_and_normalize (NMConnection *connection, ...)
|
||||
{
|
||||
gboolean was_modified;
|
||||
va_list args;
|
||||
|
||||
connection = nmtst_clone_connection (connection);
|
||||
|
||||
va_start (args, connection);
|
||||
was_modified = _nmtst_connection_normalize_v (connection, args);
|
||||
_nmtst_connection_normalize_v (connection, args);
|
||||
va_end (args);
|
||||
|
||||
return connection;
|
||||
|
|
|
|||
|
|
@ -658,12 +658,9 @@ handle_auth_or_fail (NMDeviceEthernet *self,
|
|||
NMActRequest *req,
|
||||
gboolean new_secrets)
|
||||
{
|
||||
NMDeviceEthernetPrivate *priv;
|
||||
const char *setting_name;
|
||||
NMConnection *applied_connection;
|
||||
|
||||
priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self);
|
||||
|
||||
if (!nm_device_auth_retries_try_next (NM_DEVICE (self)))
|
||||
return NM_ACT_STAGE_RETURN_FAILURE;
|
||||
|
||||
|
|
|
|||
|
|
@ -477,12 +477,9 @@ handle_auth_or_fail (NMDeviceMacsec *self,
|
|||
NMActRequest *req,
|
||||
gboolean new_secrets)
|
||||
{
|
||||
NMDeviceMacsecPrivate *priv;
|
||||
const char *setting_name;
|
||||
NMConnection *applied_connection;
|
||||
|
||||
priv = NM_DEVICE_MACSEC_GET_PRIVATE (self);
|
||||
|
||||
if (!nm_device_auth_retries_try_next (NM_DEVICE (self)))
|
||||
return NM_ACT_STAGE_RETURN_FAILURE;
|
||||
|
||||
|
|
|
|||
|
|
@ -2455,8 +2455,6 @@ nm_device_update_dynamic_ip_setup (NMDevice *self)
|
|||
{
|
||||
NMDevicePrivate *priv;
|
||||
GError *error = NULL;
|
||||
gconstpointer addr;
|
||||
size_t addr_length;
|
||||
|
||||
g_return_if_fail (NM_IS_DEVICE (self));
|
||||
|
||||
|
|
@ -2489,8 +2487,6 @@ nm_device_update_dynamic_ip_setup (NMDevice *self)
|
|||
|
||||
if (priv->lldp_listener && nm_lldp_listener_is_running (priv->lldp_listener)) {
|
||||
nm_lldp_listener_stop (priv->lldp_listener);
|
||||
addr = nm_platform_link_get_address (nm_device_get_platform (self), priv->ifindex, &addr_length);
|
||||
|
||||
if (!nm_lldp_listener_start (priv->lldp_listener, nm_device_get_ifindex (self), &error)) {
|
||||
_LOGD (LOGD_DEVICE, "LLDP listener %p could not be restarted: %s",
|
||||
priv->lldp_listener, error->message);
|
||||
|
|
@ -4822,15 +4818,12 @@ nm_device_check_connection_compatible (NMDevice *self, NMConnection *connection)
|
|||
gboolean
|
||||
nm_device_check_slave_connection_compatible (NMDevice *self, NMConnection *slave)
|
||||
{
|
||||
NMDevicePrivate *priv;
|
||||
NMSettingConnection *s_con;
|
||||
const char *connection_type, *slave_type;
|
||||
|
||||
g_return_val_if_fail (NM_IS_DEVICE (self), FALSE);
|
||||
g_return_val_if_fail (NM_IS_CONNECTION (slave), FALSE);
|
||||
|
||||
priv = NM_DEVICE_GET_PRIVATE (self);
|
||||
|
||||
if (!nm_device_is_master (self))
|
||||
return FALSE;
|
||||
|
||||
|
|
@ -5298,8 +5291,6 @@ lldp_init (NMDevice *self, gboolean restart)
|
|||
|
||||
if (priv->ifindex > 0 && lldp_rx_enabled (self)) {
|
||||
gs_free_error GError *error = NULL;
|
||||
gconstpointer addr;
|
||||
size_t addr_length;
|
||||
|
||||
if (priv->lldp_listener) {
|
||||
if (restart && nm_lldp_listener_is_running (priv->lldp_listener))
|
||||
|
|
@ -5313,8 +5304,6 @@ lldp_init (NMDevice *self, gboolean restart)
|
|||
}
|
||||
|
||||
if (!nm_lldp_listener_is_running (priv->lldp_listener)) {
|
||||
addr = nm_platform_link_get_address (nm_device_get_platform (self), priv->ifindex, &addr_length);
|
||||
|
||||
if (nm_lldp_listener_start (priv->lldp_listener, nm_device_get_ifindex (self), &error))
|
||||
_LOGD (LOGD_DEVICE, "LLDP listener %p started", priv->lldp_listener);
|
||||
else {
|
||||
|
|
@ -5527,13 +5516,9 @@ nm_device_ip_method_failed (NMDevice *self,
|
|||
int addr_family,
|
||||
NMDeviceStateReason reason)
|
||||
{
|
||||
NMDevicePrivate *priv;
|
||||
|
||||
g_return_if_fail (NM_IS_DEVICE (self));
|
||||
g_return_if_fail (NM_IN_SET (addr_family, AF_INET, AF_INET6));
|
||||
|
||||
priv = NM_DEVICE_GET_PRIVATE (self);
|
||||
|
||||
_set_ip_state (self, addr_family, IP_FAIL);
|
||||
|
||||
if (get_ip_config_may_fail (self, addr_family))
|
||||
|
|
@ -10066,7 +10051,6 @@ impl_device_delete (NMDevice *self, GDBusMethodInvocation *context)
|
|||
static gboolean
|
||||
_device_activate (NMDevice *self, NMActRequest *req)
|
||||
{
|
||||
NMDevicePrivate *priv;
|
||||
NMConnection *connection;
|
||||
|
||||
g_return_val_if_fail (NM_IS_DEVICE (self), FALSE);
|
||||
|
|
@ -10079,8 +10063,6 @@ _device_activate (NMDevice *self, NMActRequest *req)
|
|||
if (nm_active_connection_get_state (NM_ACTIVE_CONNECTION (req)) >= NM_ACTIVE_CONNECTION_STATE_DEACTIVATING)
|
||||
return FALSE;
|
||||
|
||||
priv = NM_DEVICE_GET_PRIVATE (self);
|
||||
|
||||
connection = nm_act_request_get_applied_connection (req);
|
||||
g_assert (connection);
|
||||
|
||||
|
|
|
|||
|
|
@ -1126,7 +1126,6 @@ dbus_request_scan_cb (NMDevice *device,
|
|||
gpointer user_data)
|
||||
{
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI (device);
|
||||
NMDeviceWifiPrivate *priv;
|
||||
gs_unref_variant GVariant *scan_options = user_data;
|
||||
gs_unref_ptrarray GPtrArray *ssids = NULL;
|
||||
|
||||
|
|
@ -1143,8 +1142,6 @@ dbus_request_scan_cb (NMDevice *device,
|
|||
return;
|
||||
}
|
||||
|
||||
priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||
|
||||
if (scan_options) {
|
||||
gs_unref_variant GVariant *val = g_variant_lookup_value (scan_options, "ssids", NULL);
|
||||
|
||||
|
|
@ -2942,13 +2939,10 @@ activation_success_handler (NMDevice *device)
|
|||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||
int ifindex = nm_device_get_ifindex (device);
|
||||
NMActRequest *req;
|
||||
NMConnection *applied_connection;
|
||||
|
||||
req = nm_device_get_act_request (device);
|
||||
g_assert (req);
|
||||
|
||||
applied_connection = nm_act_request_get_applied_connection (req);
|
||||
|
||||
/* Clear any critical protocol notification in the wifi stack */
|
||||
nm_platform_wifi_indicate_addressing_running (nm_device_get_platform (device), ifindex, FALSE);
|
||||
|
||||
|
|
|
|||
|
|
@ -636,7 +636,7 @@ get_max_rate_vht_160_ss3 (int mcs)
|
|||
static gboolean
|
||||
get_max_rate_ht (const guint8 *bytes, guint len, guint32 *out_maxrate)
|
||||
{
|
||||
guint32 mcs, i;
|
||||
guint32 i;
|
||||
guint8 ht_cap_info;
|
||||
const guint8 *supported_mcs_set;
|
||||
guint32 rate;
|
||||
|
|
@ -653,7 +653,6 @@ get_max_rate_ht (const guint8 *bytes, guint len, guint32 *out_maxrate)
|
|||
*out_maxrate = 0;
|
||||
|
||||
/* Find the maximum supported mcs rate */
|
||||
mcs = -1;
|
||||
for (i = 0; i <= 76; i++) {
|
||||
unsigned int mcs_octet = i / 8;
|
||||
unsigned int MCS_RATE_BIT = 1 << i % 8;
|
||||
|
|
|
|||
|
|
@ -763,8 +763,8 @@ nm_dhcp_client_handle_event (gpointer unused,
|
|||
|
||||
old_state = priv->state;
|
||||
new_state = reason_to_state (self, priv->iface, reason);
|
||||
_LOGD ("DHCP reason '%s' -> state '%s'",
|
||||
reason, state_to_string (new_state));
|
||||
_LOGD ("DHCP state '%s' -> '%s' (reason: '%s')",
|
||||
state_to_string (old_state), state_to_string (new_state), reason);
|
||||
|
||||
if (new_state == NM_DHCP_STATE_BOUND) {
|
||||
GVariantIter iter;
|
||||
|
|
|
|||
|
|
@ -367,7 +367,6 @@ static void
|
|||
dnsmasq_update_done (GDBusProxy *proxy, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
NMDnsDnsmasq *self;
|
||||
NMDnsDnsmasqPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *response = NULL;
|
||||
|
||||
|
|
@ -376,7 +375,6 @@ dnsmasq_update_done (GDBusProxy *proxy, GAsyncResult *res, gpointer user_data)
|
|||
return;
|
||||
|
||||
self = NM_DNS_DNSMASQ (user_data);
|
||||
priv = NM_DNS_DNSMASQ_GET_PRIVATE (self);
|
||||
|
||||
if (!response)
|
||||
_LOGW ("dnsmasq update failed: %s", error->message);
|
||||
|
|
|
|||
|
|
@ -381,11 +381,10 @@ static void
|
|||
write_to_netconfig (NMDnsManager *self, gint fd, const char *key, const char *value)
|
||||
{
|
||||
char *str;
|
||||
int x;
|
||||
|
||||
str = g_strdup_printf ("%s='%s'\n", key, value);
|
||||
_LOGD ("writing to netconfig: %s", str);
|
||||
x = write (fd, str, strlen (str));
|
||||
write (fd, str, strlen (str));
|
||||
g_free (str);
|
||||
}
|
||||
|
||||
|
|
@ -919,7 +918,7 @@ _collect_resolv_conf_data (NMDnsManager *self, /* only for logging context, no o
|
|||
char ***out_nis_servers,
|
||||
const char **out_nis_domain)
|
||||
{
|
||||
guint i, j, num, len;
|
||||
guint i, num, len;
|
||||
NMResolvConfData rc = {
|
||||
.nameservers = g_ptr_array_new (),
|
||||
.searches = g_ptr_array_new (),
|
||||
|
|
@ -935,7 +934,7 @@ _collect_resolv_conf_data (NMDnsManager *self, /* only for logging context, no o
|
|||
int prio, first_prio = 0;
|
||||
NMDnsIPConfigData *current;
|
||||
|
||||
for (i = 0, j = 0; i < configs->len; i++) {
|
||||
for (i = 0; i < configs->len; i++) {
|
||||
gboolean skip = FALSE;
|
||||
|
||||
current = configs->pdata[i];
|
||||
|
|
|
|||
|
|
@ -89,11 +89,9 @@ call_done (GObject *source, GAsyncResult *r, gpointer user_data)
|
|||
NMDnsSystemdResolved *self = (NMDnsSystemdResolved *) user_data;
|
||||
|
||||
v = g_dbus_proxy_call_finish (G_DBUS_PROXY (source), r, &error);
|
||||
|
||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
return;
|
||||
|
||||
if (error != NULL) {
|
||||
if (!v) {
|
||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
return;
|
||||
_LOGW ("Failed: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,8 +242,6 @@ _do_cancel_secrets (NMActRequest *self, NMActRequestGetSecretsCallId *call_id, g
|
|||
void
|
||||
nm_act_request_cancel_secrets (NMActRequest *self, NMActRequestGetSecretsCallId *call_id)
|
||||
{
|
||||
NMActRequestPrivate *priv;
|
||||
|
||||
g_return_if_fail (call_id);
|
||||
|
||||
if (self) {
|
||||
|
|
@ -255,8 +253,6 @@ nm_act_request_cancel_secrets (NMActRequest *self, NMActRequestGetSecretsCallId
|
|||
self = call_id->self;
|
||||
}
|
||||
|
||||
priv = NM_ACT_REQUEST_GET_PRIVATE (self);
|
||||
|
||||
if (!c_list_is_linked (&call_id->call_ids_lst))
|
||||
g_return_if_reached ();
|
||||
|
||||
|
|
|
|||
|
|
@ -1383,7 +1383,6 @@ intern_config_write (const char *filename,
|
|||
GKeyFile *keyfile;
|
||||
gs_strfreev char **groups = NULL;
|
||||
guint g, k;
|
||||
gboolean has_intern = FALSE;
|
||||
gboolean success = FALSE;
|
||||
GError *local = NULL;
|
||||
|
||||
|
|
@ -1449,10 +1448,7 @@ intern_config_write (const char *filename,
|
|||
|
||||
value_set = g_key_file_get_value (keyfile_intern, group, key, NULL);
|
||||
|
||||
if (is_intern) {
|
||||
has_intern = TRUE;
|
||||
g_key_file_set_value (keyfile, group, key, value_set);
|
||||
} else if (is_atomic)
|
||||
if (is_intern || is_atomic)
|
||||
g_key_file_set_value (keyfile, group, key, value_set);
|
||||
else {
|
||||
gs_free char *value_was = NULL;
|
||||
|
|
|
|||
|
|
@ -670,7 +670,6 @@ nm_ip4_config_add_dependent_routes (NMIP4Config *self,
|
|||
guint32 route_metric,
|
||||
GPtrArray **out_ip4_dev_route_blacklist)
|
||||
{
|
||||
const NMIP4ConfigPrivate *priv;
|
||||
GPtrArray *ip4_dev_route_blacklist = NULL;
|
||||
const NMPlatformIP4Address *my_addr;
|
||||
const NMPlatformIP4Route *my_route;
|
||||
|
|
@ -679,8 +678,6 @@ nm_ip4_config_add_dependent_routes (NMIP4Config *self,
|
|||
|
||||
g_return_if_fail (NM_IS_IP4_CONFIG (self));
|
||||
|
||||
priv = NM_IP4_CONFIG_GET_PRIVATE (self);
|
||||
|
||||
ifindex = nm_ip4_config_get_ifindex (self);
|
||||
g_return_if_fail (ifindex > 0);
|
||||
|
||||
|
|
@ -907,7 +904,6 @@ nm_ip4_config_merge_setting (NMIP4Config *self,
|
|||
guint32 route_table,
|
||||
guint32 route_metric)
|
||||
{
|
||||
NMIP4ConfigPrivate *priv;
|
||||
guint naddresses, nroutes, nnameservers, nsearches;
|
||||
int i, priority;
|
||||
const char *gateway_str;
|
||||
|
|
@ -918,8 +914,6 @@ nm_ip4_config_merge_setting (NMIP4Config *self,
|
|||
|
||||
g_return_if_fail (NM_IS_SETTING_IP4_CONFIG (setting));
|
||||
|
||||
priv = NM_IP4_CONFIG_GET_PRIVATE (self);
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (self));
|
||||
|
||||
naddresses = nm_setting_ip_config_get_num_addresses (setting);
|
||||
|
|
|
|||
|
|
@ -452,7 +452,6 @@ nm_ip6_config_add_dependent_routes (NMIP6Config *self,
|
|||
guint32 route_table,
|
||||
guint32 route_metric)
|
||||
{
|
||||
const NMIP6ConfigPrivate *priv;
|
||||
const NMPlatformIP6Address *my_addr;
|
||||
const NMPlatformIP6Route *my_route;
|
||||
int ifindex;
|
||||
|
|
@ -460,8 +459,6 @@ nm_ip6_config_add_dependent_routes (NMIP6Config *self,
|
|||
|
||||
g_return_if_fail (NM_IS_IP6_CONFIG (self));
|
||||
|
||||
priv = NM_IP6_CONFIG_GET_PRIVATE (self);
|
||||
|
||||
ifindex = nm_ip6_config_get_ifindex (self);
|
||||
g_return_if_fail (ifindex > 0);
|
||||
|
||||
|
|
@ -588,7 +585,6 @@ nm_ip6_config_merge_setting (NMIP6Config *self,
|
|||
guint32 route_table,
|
||||
guint32 route_metric)
|
||||
{
|
||||
NMIP6ConfigPrivate *priv;
|
||||
guint naddresses, nroutes, nnameservers, nsearches;
|
||||
const char *gateway_str;
|
||||
struct in6_addr gateway_bin;
|
||||
|
|
@ -599,8 +595,6 @@ nm_ip6_config_merge_setting (NMIP6Config *self,
|
|||
|
||||
g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
|
||||
|
||||
priv = NM_IP6_CONFIG_GET_PRIVATE (self);
|
||||
|
||||
naddresses = nm_setting_ip_config_get_num_addresses (setting);
|
||||
nroutes = nm_setting_ip_config_get_num_routes (setting);
|
||||
nnameservers = nm_setting_ip_config_get_num_dns (setting);
|
||||
|
|
@ -828,8 +822,6 @@ nm_ip6_config_merge (NMIP6Config *dst,
|
|||
NMIPConfigMergeFlags merge_flags,
|
||||
guint32 default_route_metric_penalty)
|
||||
{
|
||||
NMIP6ConfigPrivate *dst_priv;
|
||||
const NMIP6ConfigPrivate *src_priv;
|
||||
guint32 i;
|
||||
NMDedupMultiIter ipconf_iter;
|
||||
const NMPlatformIP6Address *address = NULL;
|
||||
|
|
@ -837,9 +829,6 @@ nm_ip6_config_merge (NMIP6Config *dst,
|
|||
g_return_if_fail (src != NULL);
|
||||
g_return_if_fail (dst != NULL);
|
||||
|
||||
dst_priv = NM_IP6_CONFIG_GET_PRIVATE (dst);
|
||||
src_priv = NM_IP6_CONFIG_GET_PRIVATE (src);
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (dst));
|
||||
|
||||
/* addresses */
|
||||
|
|
@ -1705,14 +1694,11 @@ nm_ip6_config_lookup_address (const NMIP6Config *self,
|
|||
const NMPlatformIP6Address *
|
||||
nm_ip6_config_get_address_first_nontentative (const NMIP6Config *self, gboolean linklocal)
|
||||
{
|
||||
const NMIP6ConfigPrivate *priv;
|
||||
const NMPlatformIP6Address *addr;
|
||||
NMDedupMultiIter iter;
|
||||
|
||||
g_return_val_if_fail (NM_IS_IP6_CONFIG (self), NULL);
|
||||
|
||||
priv = NM_IP6_CONFIG_GET_PRIVATE (self);
|
||||
|
||||
linklocal = !!linklocal;
|
||||
|
||||
nm_ip_config_iter_ip6_address_for_each (&iter, self, &addr) {
|
||||
|
|
|
|||
|
|
@ -3249,8 +3249,6 @@ ensure_master_active_connection (NMManager *self,
|
|||
NM_MANAGER_ERROR_DEPENDENCY_FAILED,
|
||||
"Device unmanaged or not available for activation");
|
||||
} else if (master_connection) {
|
||||
gboolean found_device = FALSE;
|
||||
|
||||
/* Find a compatible device and activate it using this connection */
|
||||
for (iter = priv->devices; iter; iter = g_slist_next (iter)) {
|
||||
NMDevice *candidate = NM_DEVICE (iter->data);
|
||||
|
|
@ -3263,7 +3261,6 @@ ensure_master_active_connection (NMManager *self,
|
|||
if (!nm_device_check_connection_available (candidate, NM_CONNECTION (master_connection), NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST, NULL))
|
||||
continue;
|
||||
|
||||
found_device = TRUE;
|
||||
if (!nm_device_is_software (candidate)) {
|
||||
master_state = nm_device_get_state (candidate);
|
||||
if (nm_device_is_real (candidate) && master_state != NM_DEVICE_STATE_DISCONNECTED)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|||
typedef struct {
|
||||
NMPlatform *platform;
|
||||
NMPNetns *platform_netns;
|
||||
bool log_with_ptr;
|
||||
} NMNetnsPrivate;
|
||||
|
||||
struct _NMNetns {
|
||||
|
|
@ -113,13 +112,10 @@ constructed (GObject *object)
|
|||
{
|
||||
NMNetns *self = NM_NETNS (object);
|
||||
NMNetnsPrivate *priv = NM_NETNS_GET_PRIVATE (self);
|
||||
gboolean log_with_ptr;
|
||||
|
||||
if (!priv->platform)
|
||||
g_return_if_reached ();
|
||||
|
||||
log_with_ptr = nm_platform_get_log_with_ptr (priv->platform);
|
||||
|
||||
priv->platform_netns = nm_platform_netns_get (priv->platform);
|
||||
|
||||
G_OBJECT_CLASS (nm_netns_parent_class)->constructed (object);
|
||||
|
|
|
|||
|
|
@ -466,19 +466,18 @@ static void
|
|||
pacrunner_remove_done (GObject *source, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
Config *config = user_data;
|
||||
NMPacrunnerManager *self;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *ret = NULL;
|
||||
|
||||
ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (source), res, &error);
|
||||
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
goto out;
|
||||
|
||||
self = NM_PACRUNNER_MANAGER (config->manager_maybe_dangling);
|
||||
if (!ret)
|
||||
if (!ret) {
|
||||
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
goto out;
|
||||
_LOG2D (config, "remove failed: %s", error->message);
|
||||
else
|
||||
_LOG2D (config, "removed");
|
||||
goto out;
|
||||
}
|
||||
|
||||
_LOG2D (config, "removed");
|
||||
|
||||
out:
|
||||
config_unref (config);
|
||||
|
|
|
|||
|
|
@ -1526,8 +1526,6 @@ const NMPLookup *
|
|||
nmp_lookup_init_obj_type (NMPLookup *lookup,
|
||||
NMPObjectType obj_type)
|
||||
{
|
||||
NMPObject *o;
|
||||
|
||||
nm_assert (lookup);
|
||||
|
||||
switch (obj_type) {
|
||||
|
|
@ -1538,7 +1536,7 @@ nmp_lookup_init_obj_type (NMPLookup *lookup,
|
|||
case NMP_OBJECT_TYPE_IP6_ROUTE:
|
||||
case NMP_OBJECT_TYPE_QDISC:
|
||||
case NMP_OBJECT_TYPE_TFILTER:
|
||||
o = _nmp_object_stackinit_from_type (&lookup->selector_obj, obj_type);
|
||||
_nmp_object_stackinit_from_type (&lookup->selector_obj, obj_type);
|
||||
lookup->cache_id_type = NMP_CACHE_ID_TYPE_OBJECT_TYPE;
|
||||
return _L (lookup);
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -44,11 +44,9 @@ nm_ppp_manager_create (const char *iface, GError **error)
|
|||
GError *error_local = NULL;
|
||||
NMPPPOps *ops;
|
||||
struct stat st;
|
||||
int errsv;
|
||||
|
||||
if (G_UNLIKELY (!ppp_ops)) {
|
||||
if (stat (PPP_PLUGIN_PATH, &st) != 0) {
|
||||
errsv = errno;
|
||||
g_set_error_literal (error,
|
||||
NM_MANAGER_ERROR, NM_MANAGER_ERROR_MISSING_PLUGIN,
|
||||
"the PPP plugin " PPP_PLUGIN_PATH " is not installed");
|
||||
|
|
|
|||
|
|
@ -570,13 +570,9 @@ _update_prepare (NMSettingsConnection *self,
|
|||
NMConnection *new_connection,
|
||||
GError **error)
|
||||
{
|
||||
NMSettingsConnectionPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (self), FALSE);
|
||||
g_return_val_if_fail (NM_IS_CONNECTION (new_connection), FALSE);
|
||||
|
||||
priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self);
|
||||
|
||||
if (!nm_connection_normalize (new_connection, NULL, NULL, error))
|
||||
return FALSE;
|
||||
|
||||
|
|
|
|||
|
|
@ -369,7 +369,6 @@ nm_supplicant_config_add_setting_macsec (NMSupplicantConfig * self,
|
|||
NMSettingMacsec * setting,
|
||||
GError **error)
|
||||
{
|
||||
NMSupplicantConfigPrivate *priv;
|
||||
gs_unref_bytes GBytes *bytes = NULL;
|
||||
const char *value;
|
||||
char buf[32];
|
||||
|
|
@ -379,8 +378,6 @@ nm_supplicant_config_add_setting_macsec (NMSupplicantConfig * self,
|
|||
g_return_val_if_fail (setting != NULL, FALSE);
|
||||
g_return_val_if_fail (!error || !*error, FALSE);
|
||||
|
||||
priv = NM_SUPPLICANT_CONFIG_GET_PRIVATE (self);
|
||||
|
||||
if (!nm_supplicant_config_add_option (self, "macsec_policy", "1", -1, NULL, error))
|
||||
return FALSE;
|
||||
|
||||
|
|
|
|||
|
|
@ -1198,7 +1198,6 @@ static void
|
|||
interface_get_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
NMSupplicantInterface *self;
|
||||
NMSupplicantInterfacePrivate *priv;
|
||||
gs_unref_variant GVariant *variant = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
const char *path;
|
||||
|
|
@ -1210,7 +1209,6 @@ interface_get_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
|
|||
return;
|
||||
|
||||
self = NM_SUPPLICANT_INTERFACE (user_data);
|
||||
priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
|
||||
|
||||
if (variant) {
|
||||
g_variant_get (variant, "(&o)", &path);
|
||||
|
|
|
|||
|
|
@ -1460,6 +1460,11 @@ test_nm_utils_strbuf_append (void)
|
|||
static void
|
||||
test_duplicate_decl_specifier (void)
|
||||
{
|
||||
/* We're intentionally assigning values to static arrays v_const
|
||||
* and v_result without using it afterwards just so that valgrind
|
||||
* doesn't complain about the leak. */
|
||||
NM_PRAGMA_WARNING_DISABLE("-Wunused-but-set-variable")
|
||||
|
||||
/* have some static variables, so that the result is certainly not optimized out. */
|
||||
static const int v_const[1] = { 1 };
|
||||
static int v_result[1] = { };
|
||||
|
|
@ -1477,6 +1482,8 @@ test_duplicate_decl_specifier (void)
|
|||
})
|
||||
|
||||
v_result[0] = TEST_MAX (v_const[0], nmtst_get_rand_int () % 5) + v2;
|
||||
|
||||
NM_PRAGMA_WARNING_REENABLE
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -2549,7 +2549,6 @@ static void
|
|||
plugin_new_secrets_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
NMVpnConnection *self;
|
||||
NMVpnConnectionPrivate *priv;
|
||||
gs_unref_variant GVariant *reply = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
|
|
@ -2558,7 +2557,6 @@ plugin_new_secrets_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_da
|
|||
return;
|
||||
|
||||
self = NM_VPN_CONNECTION (user_data);
|
||||
priv = NM_VPN_CONNECTION_GET_PRIVATE (self);
|
||||
|
||||
if (error) {
|
||||
g_dbus_error_strip_remote_error (error);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue