mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 04:18:07 +02:00
l3cfg: minor adjustments for L3Cfg code
This commit is contained in:
parent
1ce02ffd50
commit
8258ce6cf6
2 changed files with 25 additions and 4 deletions
|
|
@ -2582,18 +2582,19 @@ _l3_commit_on_idle_cb(gpointer user_data)
|
||||||
return G_SOURCE_REMOVE;
|
return G_SOURCE_REMOVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
nm_l3cfg_commit_on_idle_schedule(NML3Cfg *self)
|
nm_l3cfg_commit_on_idle_schedule(NML3Cfg *self)
|
||||||
{
|
{
|
||||||
nm_assert(NM_IS_L3CFG(self));
|
nm_assert(NM_IS_L3CFG(self));
|
||||||
|
|
||||||
if (self->priv.p->commit_on_idle_source)
|
if (self->priv.p->commit_on_idle_source)
|
||||||
return;
|
return FALSE;
|
||||||
|
|
||||||
_LOGT("commit on idle (scheduled)");
|
_LOGT("commit on idle (scheduled)");
|
||||||
self->priv.p->commit_on_idle_source =
|
self->priv.p->commit_on_idle_source =
|
||||||
nm_g_idle_source_new(G_PRIORITY_DEFAULT, _l3_commit_on_idle_cb, self, NULL);
|
nm_g_idle_source_new(G_PRIORITY_DEFAULT, _l3_commit_on_idle_cb, self, NULL);
|
||||||
g_source_attach(self->priv.p->commit_on_idle_source, NULL);
|
g_source_attach(self->priv.p->commit_on_idle_source, NULL);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
@ -3697,6 +3698,23 @@ _nm_l3cfg_unregister_ipv4ll(NML3Cfg *self)
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
nm_l3cfg_is_ready(NML3Cfg *self)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail(NM_IS_L3CFG(self), FALSE);
|
||||||
|
|
||||||
|
if (self->priv.p->changed_configs_configs)
|
||||||
|
return FALSE;
|
||||||
|
if (self->priv.p->changed_configs_acd_state)
|
||||||
|
return FALSE;
|
||||||
|
if (self->priv.p->commit_on_idle_source)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,8 @@ typedef enum {
|
||||||
|
|
||||||
NM_L3_CONFIG_NOTIFY_TYPE_ACD_EVENT,
|
NM_L3_CONFIG_NOTIFY_TYPE_ACD_EVENT,
|
||||||
|
|
||||||
/* emitted at the end of nm_l3cfg_platform_commit(). */
|
/* emitted at the end of nm_l3cfg_platform_commit(). This signals also that
|
||||||
|
* nm_l3cfg_is_ready() might have switched to TRUE. */
|
||||||
NM_L3_CONFIG_NOTIFY_TYPE_POST_COMMIT,
|
NM_L3_CONFIG_NOTIFY_TYPE_POST_COMMIT,
|
||||||
|
|
||||||
/* NML3Cfg hooks to the NMPlatform signals for link, addresses and routes.
|
/* NML3Cfg hooks to the NMPlatform signals for link, addresses and routes.
|
||||||
|
|
@ -170,6 +171,8 @@ NML3Cfg *nm_l3cfg_new(NMNetns *netns, int ifindex);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
gboolean nm_l3cfg_is_ready(NML3Cfg *self);
|
||||||
|
|
||||||
void _nm_l3cfg_notify_platform_change_on_idle(NML3Cfg *self, guint32 obj_type_flags);
|
void _nm_l3cfg_notify_platform_change_on_idle(NML3Cfg *self, guint32 obj_type_flags);
|
||||||
|
|
||||||
void _nm_l3cfg_notify_platform_change(NML3Cfg * self,
|
void _nm_l3cfg_notify_platform_change(NML3Cfg * self,
|
||||||
|
|
@ -328,7 +331,7 @@ typedef enum _nm_packed {
|
||||||
|
|
||||||
void nm_l3cfg_commit(NML3Cfg *self, NML3CfgCommitType commit_type);
|
void nm_l3cfg_commit(NML3Cfg *self, NML3CfgCommitType commit_type);
|
||||||
|
|
||||||
void nm_l3cfg_commit_on_idle_schedule(NML3Cfg *self);
|
gboolean nm_l3cfg_commit_on_idle_schedule(NML3Cfg *self);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue