diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index bf7b859b1..81cd41458 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -949,11 +949,11 @@ static const char *signal_by_type_and_status[N_TYPES][N_STATUSES] = { }; static struct nl_cache * -choose_cache (NMPlatform *platform, struct nl_object *object) +choose_cache_by_type (NMPlatform *platform, ObjectType object_type) { NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform); - switch (object_type_from_nl_object (object)) { + switch (object_type) { case LINK: return priv->link_cache; case IP4_ADDRESS: @@ -968,6 +968,12 @@ choose_cache (NMPlatform *platform, struct nl_object *object) } } +static struct nl_cache * +choose_cache (NMPlatform *platform, struct nl_object *object) +{ + return choose_cache_by_type (platform, object_type_from_nl_object (object)); +} + static gboolean object_has_ifindex (struct nl_object *object, int ifindex) {