mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-23 14:22:36 +01:00
hwsim: Fix netlink attribute size calculation
The name attribute in the NEW RADIO command needs at least 4 bytes for the attribute header (struct nlattr), all the characters of the name string and a NUL byte, and up to 3 bytes of alignment padding. Otherwise, depending on the name length and whether the NO_VIF attribute was the last, that attribute could end up being dropped and we were ending up with too many interfaces inside test-runner.
This commit is contained in:
parent
ba5d5430e1
commit
ea9edc1f99
@ -2090,7 +2090,7 @@ static void hwsim_ready(void *user_data)
|
||||
msg_size += 4;
|
||||
|
||||
if (radio_name_attr)
|
||||
msg_size += strlen(radio_name_attr) + 1;
|
||||
msg_size += strlen(radio_name_attr) + 8;
|
||||
|
||||
if (no_vif_attr)
|
||||
msg_size += 4;
|
||||
|
Loading…
Reference in New Issue
Block a user