summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2020-06-10 16:33:30 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2020-06-12 16:04:06 +0200
commitd90c7b70f3c6c224a0713651df712b725d5e3a72 (patch)
treea9376ce77013f34353396bfea588881b2235c480
parent808e837149978fc16b1aa90260600a764cecb284 (diff)
downloadNetworkManager-d90c7b70f3c6c224a0713651df712b725d5e3a72.tar.gz
device: honor the match.path property
-rw-r--r--src/devices/nm-device.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index a7b1e02df2..63fa5a5cc9 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -6295,6 +6295,7 @@ nm_device_match_parent_hwaddr (NMDevice *device,
static gboolean
check_connection_compatible (NMDevice *self, NMConnection *connection, GError **error)
{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
const char *device_iface = nm_device_get_iface (self);
gs_free_error GError *local = NULL;
gs_free char *conn_iface = NULL;
@@ -6439,6 +6440,13 @@ check_connection_compatible (NMDevice *self, NMConnection *connection, GError **
"device does not satisfy match.driver property");
return FALSE;
}
+
+ patterns = nm_setting_match_get_paths (s_match, &num_patterns);
+ if (!nm_wildcard_match_check (priv->path, patterns, num_patterns)) {
+ nm_utils_error_set_literal (error, NM_UTILS_ERROR_CONNECTION_AVAILABLE_INCOMPATIBLE,
+ "device does not satisfy match.path property");
+ return FALSE;
+ }
}
return TRUE;