diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-02-11 13:48:46 -0800 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-02-16 15:16:29 -0800 |
commit | a1cdd683dfebafdb37b29b0155f04457bc44c7d4 (patch) | |
tree | 7864747517530b3b047345a9dab39195eab467ae /src/adapter.c | |
parent | ec8c8f22efb66ccae533fbd55a236570ffcf756c (diff) | |
download | bluez-a1cdd683dfebafdb37b29b0155f04457bc44c7d4.tar.gz |
main.conf: Introduce MaxControllers
This introduces MaxControllers which can be used to limit the number of
adapters exposed in the system.
Diffstat (limited to 'src/adapter.c')
-rw-r--r-- | src/adapter.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/adapter.c b/src/adapter.c index 2071cf8db..1551011a8 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -10078,6 +10078,13 @@ static void index_added(uint16_t index, uint16_t length, const void *param, return; } + /* Check if at maximum adapters allowed in the system then ignore the + * adapter. + */ + if (btd_opts.max_adapters && + btd_opts.max_adapters == g_slist_length(adapters)) + return; + reset_adv_monitors(index); adapter = btd_adapter_new(index); |