mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-22 10:46:59 +00:00
cloud-setup: limit number of supported interfaces to avoid overlapping table numbers
The table number is chosen as 30400 + iface_idx. That is, the range is limited and we shouldn't handle more than 100 devices. Add a check for that and error out.
This commit is contained in:
parent
a95ea0eb29
commit
b68d694b78
|
@ -438,6 +438,14 @@ _config_one(GCancellable * sigterm_cancellable,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (config_data->iface_idx >= 100) {
|
||||
/* since we use the iface_idx to select a table number, the range is limited from
|
||||
* 0 to 99. Note that the providers are required to provide increasing numbers,
|
||||
* so this means we bail out after the first 100 devices. */
|
||||
_LOGD("config device %s: skip because number of supported interfaces reached", hwaddr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
_LOGD("config device %s: configuring \"%s\" (%s)...",
|
||||
hwaddr,
|
||||
nm_device_get_iface(device) ?: "/unknown/",
|
||||
|
|
Loading…
Reference in a new issue