core: merge branch 'bg/rh1542366'

https://bugzilla.redhat.com/show_bug.cgi?id=1542366
This commit is contained in:
Beniamino Galvani 2018-09-05 16:49:41 +02:00
commit c7c989804f
3 changed files with 35 additions and 20 deletions

View file

@ -4407,6 +4407,9 @@ nm_device_unrealize (NMDevice *self, gboolean remove_resources, GError **error)
}
}
nm_clear_g_source (&priv->queued_ip_config_id_4);
nm_clear_g_source (&priv->queued_ip_config_id_6);
g_object_freeze_notify (G_OBJECT (self));
NM_DEVICE_GET_CLASS (self)->unrealize_notify (self);

View file

@ -3083,10 +3083,21 @@ platform_link_added (NMManager *self,
continue;
if (nm_device_is_real (candidate)) {
/* Ignore the link added event since there's already a realized
* device with the link's name.
/* There's already a realized device with the link's name
* and a different ifindex.
*/
nm_device_update_from_platform_link (candidate, plink);
if (nm_device_get_ifindex (candidate) <= 0)
nm_device_update_from_platform_link (candidate, plink);
else {
/* The ifindex of a device can't be changed after
* initialization because it is used as a key by
* the dns-manager.
*/
_LOGD (LOGD_DEVICE, "(%s): removing old device %p after ifindex change from %d to %d",
plink->name, candidate, nm_device_get_ifindex (candidate), ifindex);
remove_device (self, candidate, FALSE, TRUE);
goto add;
}
return;
} else if (nm_device_realize_start (candidate,
plink,
@ -3106,6 +3117,7 @@ platform_link_added (NMManager *self,
/* Try next unrealized device */
}
add:
/* Try registered device factories */
factory = nm_device_factory_manager_find_factory_for_link_type (plink->type);
if (factory) {

View file

@ -3405,7 +3405,7 @@ typedef struct {
WaitForNlResponseResult *out_seq_result;
char **out_errmsg;
union {
int *out_refresh_all_in_progess;
int *out_refresh_all_in_progress;
NMPObject **out_route_get;
gpointer out_data;
} response;
@ -3437,7 +3437,7 @@ typedef struct {
/* counter that a refresh all action is in progress, separated
* by type. */
int refresh_all_in_progess[_DELAYED_ACTION_IDX_REFRESH_ALL_NUM];
int refresh_all_in_progress[_DELAYED_ACTION_IDX_REFRESH_ALL_NUM];
GPtrArray *list_master_connected;
GPtrArray *list_refresh_link;
@ -3910,7 +3910,7 @@ delayed_action_refresh_all_in_progress (NMPlatform *platform, DelayedActionType
if (NM_FLAGS_ANY (priv->delayed_action.flags, action_type))
return TRUE;
if (priv->delayed_action.refresh_all_in_progess[delayed_action_refresh_all_to_idx (action_type)] > 0)
if (priv->delayed_action.refresh_all_in_progress[delayed_action_refresh_all_to_idx (action_type)] > 0)
return TRUE;
return FALSE;
@ -3940,10 +3940,10 @@ delayed_action_wait_for_nl_response_complete (NMPlatform *platform,
case DELAYED_ACTION_RESPONSE_TYPE_VOID:
break;
case DELAYED_ACTION_RESPONSE_TYPE_REFRESH_ALL_IN_PROGRESS:
if (data->response.out_refresh_all_in_progess) {
nm_assert (*data->response.out_refresh_all_in_progess > 0);
*data->response.out_refresh_all_in_progess -= 1;
data->response.out_refresh_all_in_progess = NULL;
if (data->response.out_refresh_all_in_progress) {
nm_assert (*data->response.out_refresh_all_in_progress > 0);
*data->response.out_refresh_all_in_progress -= 1;
data->response.out_refresh_all_in_progress = NULL;
}
break;
case DELAYED_ACTION_RESPONSE_TYPE_ROUTE_GET:
@ -4666,11 +4666,11 @@ do_request_all_no_delayed_actions (NMPlatform *platform, DelayedActionType actio
const NMPClass *klass = nmp_class_from_type (obj_type);
nm_auto_nlmsg struct nl_msg *nlmsg = NULL;
int nle;
int *out_refresh_all_in_progess;
int *out_refresh_all_in_progress;
out_refresh_all_in_progess = &priv->delayed_action.refresh_all_in_progess[delayed_action_refresh_all_to_idx (iflags)];
nm_assert (*out_refresh_all_in_progess >= 0);
*out_refresh_all_in_progess += 1;
out_refresh_all_in_progress = &priv->delayed_action.refresh_all_in_progress[delayed_action_refresh_all_to_idx (iflags)];
nm_assert (*out_refresh_all_in_progress >= 0);
*out_refresh_all_in_progress += 1;
/* clear any delayed action that request a refresh of this object type. */
priv->delayed_action.flags &= ~iflags;
@ -4704,9 +4704,9 @@ do_request_all_no_delayed_actions (NMPlatform *platform, DelayedActionType actio
if (nle < 0)
continue;
if (_nl_send_nlmsg (platform, nlmsg, NULL, NULL, DELAYED_ACTION_RESPONSE_TYPE_REFRESH_ALL_IN_PROGRESS, out_refresh_all_in_progess) < 0) {
nm_assert (*out_refresh_all_in_progess > 0);
*out_refresh_all_in_progess -= 1;
if (_nl_send_nlmsg (platform, nlmsg, NULL, NULL, DELAYED_ACTION_RESPONSE_TYPE_REFRESH_ALL_IN_PROGRESS, out_refresh_all_in_progress) < 0) {
nm_assert (*out_refresh_all_in_progress > 0);
*out_refresh_all_in_progress -= 1;
}
}
}
@ -4735,10 +4735,10 @@ event_seq_check_refresh_all (NMPlatform *platform, guint32 seq_number)
data = &g_array_index (priv->delayed_action.list_wait_for_nl_response, DelayedActionWaitForNlResponseData, i);
if ( data->response_type == DELAYED_ACTION_RESPONSE_TYPE_REFRESH_ALL_IN_PROGRESS
&& data->response.out_refresh_all_in_progess
&& data->response.out_refresh_all_in_progress
&& data->seq_number == priv->nlh_seq_last_seen) {
*data->response.out_refresh_all_in_progess -= 1;
data->response.out_refresh_all_in_progess = NULL;
*data->response.out_refresh_all_in_progress -= 1;
data->response.out_refresh_all_in_progress = NULL;
break;
}
}