mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-24 05:40:42 +02:00
l3cfg: add nm_l3cfg_get_best_default_route() function
This is the best default route that we commited the last time (if any). It may not reflect what is currently configured (in NMPlatform) and it may not reflect the latest changes since nm_l3cfg_add_config().
This commit is contained in:
parent
3b8b683f8a
commit
6358d10688
2 changed files with 25 additions and 0 deletions
|
|
@ -3018,6 +3018,26 @@ nm_l3cfg_commit_type_unregister (NML3Cfg *self,
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
const NMPObject *
|
||||
nm_l3cfg_get_best_default_route (NML3Cfg *self,
|
||||
int addr_family)
|
||||
{
|
||||
nm_assert (NM_IS_L3CFG (self));
|
||||
|
||||
/* we only consider the combined_l3cd. This is a merge of all the l3cd, and the one
|
||||
* with which we called nm_l3cfg_platform_commit() the last time.
|
||||
*
|
||||
* In the meantime, we might have changed the tracked l3_config_datas, but we didn't
|
||||
* nm_l3cfg_platform_commit() yet. These changes are ignored for this purpose, until
|
||||
* the user call nm_l3cfg_platform_commit() to re-commit the changes. */
|
||||
if (!self->priv.p->combined_l3cd)
|
||||
return NULL;
|
||||
|
||||
return nm_l3_config_data_get_best_default_route (self->priv.p->combined_l3cd, addr_family);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
set_property (GObject *object,
|
||||
guint prop_id,
|
||||
|
|
|
|||
|
|
@ -220,4 +220,9 @@ void nm_l3cfg_commit_type_unregister (NML3Cfg *self,
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
const NMPObject *nm_l3cfg_get_best_default_route (NML3Cfg *self,
|
||||
int addr_family);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#endif /* __NM_L3CFG_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue