summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-02-13 16:08:36 +0100
committerThomas Haller <thaller@redhat.com>2014-02-14 21:40:58 +0100
commita5f3fcae295b2bc9e39cf37b95c7e87a45eec76a (patch)
tree861c88a27c7d136232799177c8092b6694a45669
parentdc54b2e3b2565b9af6478f98e004eaa478809e51 (diff)
downloadNetworkManager-a5f3fcae295b2bc9e39cf37b95c7e87a45eec76a.tar.gz
platform: add function choose_cache_by_type()
Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--src/platform/nm-linux-platform.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index bf7b859b11..81cd41458d 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)
{