device: keep NMNetns instance per device
This also ensures that we own a reference to the
NMPlatform, NMRouteManager and NMDefaultRouteManager
instances. See bug rh#1440089 where we might access
the singleton getter after destroing the singleton
instance of NMRouteManager. This is prevented by
keeping a reference to those instances -- indirectly
via the netns instance.
Later, we may add support for multiple namespaces. Then it might
make sense to swap the NMNetns instance of a device when moving
the device between namespaces.
Also, drop the use of singelton instances.
https://bugzilla.redhat.com/show_bug.cgi?id=1440089
(cherry picked from commit c48a19b7c6
)
This commit is contained in:
@@ -62,20 +62,6 @@ NM_DEFINE_SINGLETON_GETTER (NMNetns, nm_netns_get, NM_TYPE_NETNS);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
NMRouteManager *
|
||||
nm_route_manager_get (void)
|
||||
{
|
||||
return nm_netns_get_route_manager (NM_NETNS_GET);
|
||||
}
|
||||
|
||||
NMDefaultRouteManager *
|
||||
nm_default_route_manager_get (void)
|
||||
{
|
||||
return nm_netns_get_default_route_manager (NM_NETNS_GET);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
NMPNetns *
|
||||
nm_netns_get_platform_netns (NMNetns *self)
|
||||
{
|
||||
|
Reference in New Issue
Block a user