core: pass NMDedupMultiIndex instance to NMIP4Config and other
NMIP4Config, NMIP6Config, and NMPlatform shall share one NMDedupMultiIndex instance. For that, pass an NMDedupMultiIndex instance to NMPlatform and NMNetns. NMNetns than passes it on to NMDevice, NMDhcpClient, NMIP4Config and NMIP6Config. So currently NMNetns is the access point to the shared NMDedupMultiIndex instance, and it gets it from it's NMPlatform instance. The NMDedupMultiIndex instance is really a singleton, we don't want multiple instances of it. However, for testing, instead of adding a singleton instance, pass the instance explicitly around.
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
|
||||
#include "nm-netns.h"
|
||||
|
||||
#include "nm-utils/nm-dedup-multi.h"
|
||||
|
||||
#include "platform/nm-platform.h"
|
||||
#include "platform/nmp-netns.h"
|
||||
#include "nm-route-manager.h"
|
||||
@@ -74,6 +76,12 @@ nm_netns_get_platform (NMNetns *self)
|
||||
return NM_NETNS_GET_PRIVATE (self)->platform;
|
||||
}
|
||||
|
||||
NMDedupMultiIndex *
|
||||
nm_netns_get_multi_idx (NMNetns *self)
|
||||
{
|
||||
return nm_platform_get_multi_idx (NM_NETNS_GET_PRIVATE (self)->platform);
|
||||
}
|
||||
|
||||
NMDefaultRouteManager *
|
||||
nm_netns_get_default_route_manager (NMNetns *self)
|
||||
{
|
||||
|
Reference in New Issue
Block a user