mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 15:20:08 +01:00
device: handle match.driver also with unknown device driver
If the driver is unknown, that doesn't necessarily mean that the match passes. Instead, the match passes if there is no positive match that asks for the driver name.
This commit is contained in:
parent
623cf7c9a3
commit
bdd0e89b9a
1 changed files with 7 additions and 11 deletions
|
|
@ -6042,6 +6042,7 @@ check_connection_compatible (NMDevice *self, NMConnection *connection, GError **
|
|||
NM_TYPE_SETTING_MATCH);
|
||||
if (s_match) {
|
||||
const char *const *patterns;
|
||||
const char *device_driver;
|
||||
guint num_patterns = 0;
|
||||
|
||||
/* interface_names */
|
||||
|
|
@ -6104,17 +6105,12 @@ check_connection_compatible (NMDevice *self, NMConnection *connection, GError **
|
|||
}
|
||||
}
|
||||
|
||||
{ /* driver */
|
||||
const char *device_driver = nm_device_get_driver (self);
|
||||
|
||||
if (device_driver) {
|
||||
patterns = nm_setting_match_get_drivers (s_match, &num_patterns);
|
||||
if (!nm_wildcard_match_check (device_driver, patterns, num_patterns)) {
|
||||
nm_utils_error_set_literal (error, NM_UTILS_ERROR_CONNECTION_AVAILABLE_TEMPORARY,
|
||||
"device does not satisfy match.driver property");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
device_driver = nm_device_get_driver (self);
|
||||
patterns = nm_setting_match_get_drivers (s_match, &num_patterns);
|
||||
if (!nm_wildcard_match_check (device_driver, patterns, num_patterns)) {
|
||||
nm_utils_error_set_literal (error, NM_UTILS_ERROR_CONNECTION_AVAILABLE_TEMPORARY,
|
||||
"device does not satisfy match.driver property");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue