summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2018-05-24 15:03:40 +0200
committerLubomir Rintel <lkundrak@v3.sk>2018-06-26 16:21:54 +0200
commit732b63ffb7d9c4cc8f3ec04a89a02d0ab3ae5aad (patch)
tree1d7c6c05f0a888eaeb2976bb6245f2589305a01a
parent6371f399ae6b69ccc2ca743b77803ba1ffa8d17e (diff)
downloadNetworkManager-732b63ffb7d9c4cc8f3ec04a89a02d0ab3ae5aad.tar.gz
paltform: add type argument to nm_platform_link_get_by_address()
Devices of different link types can actually have the same MAC address. We'll want to use this to find a device of a particular type by its hardware address.
-rw-r--r--src/platform/nm-platform.c5
-rw-r--r--src/platform/nm-platform.h4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
index 96bb2928ef..3fc3ee247a 100644
--- a/src/platform/nm-platform.c
+++ b/src/platform/nm-platform.c
@@ -15,7 +15,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright (C) 2012 - 2017 Red Hat, Inc.
+ * Copyright (C) 2012 - 2018 Red Hat, Inc.
*/
#include "nm-default.h"
@@ -807,6 +807,7 @@ _nm_platform_link_get_by_address_match_link (const NMPObject *obj, struct _nm_pl
**/
const NMPlatformLink *
nm_platform_link_get_by_address (NMPlatform *self,
+ NMLinkType link_type,
gconstpointer address,
size_t length)
{
@@ -827,7 +828,7 @@ nm_platform_link_get_by_address (NMPlatform *self,
g_return_val_if_reached (NULL);
obj = nmp_cache_lookup_link_full (nm_platform_get_cache (self),
- 0, NULL, TRUE, NM_LINK_TYPE_NONE,
+ 0, NULL, TRUE, link_type,
(NMPObjectMatchFn) _nm_platform_link_get_by_address_match_link, &d);
return NMP_OBJECT_CAST_LINK (obj);
}
diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h
index 84d10d2af0..a19c3289dd 100644
--- a/src/platform/nm-platform.h
+++ b/src/platform/nm-platform.h
@@ -15,7 +15,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright (C) 2009 - 2017 Red Hat, Inc.
+ * Copyright (C) 2009 - 2018 Red Hat, Inc.
*/
#ifndef __NETWORKMANAGER_PLATFORM_H__
@@ -1079,7 +1079,7 @@ const NMPObject *nm_platform_link_get_obj (NMPlatform *self,
gboolean visible_only);
const NMPlatformLink *nm_platform_link_get (NMPlatform *self, int ifindex);
const NMPlatformLink *nm_platform_link_get_by_ifname (NMPlatform *self, const char *ifname);
-const NMPlatformLink *nm_platform_link_get_by_address (NMPlatform *self, gconstpointer address, size_t length);
+const NMPlatformLink *nm_platform_link_get_by_address (NMPlatform *self, NMLinkType link_type, gconstpointer address, size_t length);
GPtrArray *nm_platform_link_get_all (NMPlatform *self, gboolean sort_by_name);
NMPlatformError nm_platform_link_dummy_add (NMPlatform *self, const char *name, const NMPlatformLink **out_link);