mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-02 09:22:32 +01:00
ie: Allow building an empty IE sequence in ie_tlv_builder_finalize
Since we use the special 0xffff value in the builder code, check that the tag is not 0xffff in ie_tlv_builder_finalize before writing the header. This is for consistency, not for a specific use case.
This commit is contained in:
parent
5d8cb6260f
commit
025d8dad44
9
src/ie.c
9
src/ie.c
@ -330,11 +330,14 @@ bool ie_tlv_builder_recurse(struct ie_tlv_builder *builder,
|
|||||||
void ie_tlv_builder_finalize(struct ie_tlv_builder *builder,
|
void ie_tlv_builder_finalize(struct ie_tlv_builder *builder,
|
||||||
unsigned int *out_len)
|
unsigned int *out_len)
|
||||||
{
|
{
|
||||||
unsigned int len;
|
unsigned int len = 0;
|
||||||
|
|
||||||
ie_tlv_builder_write_header(builder);
|
if (builder->tag != 0xffff) {
|
||||||
|
ie_tlv_builder_write_header(builder);
|
||||||
|
|
||||||
len = builder->pos + TLV_HEADER_LEN + builder->tlv[builder->pos + 1];
|
len = builder->pos + TLV_HEADER_LEN +
|
||||||
|
builder->tlv[builder->pos + 1];
|
||||||
|
}
|
||||||
|
|
||||||
if (out_len)
|
if (out_len)
|
||||||
*out_len = len;
|
*out_len = len;
|
||||||
|
Loading…
Reference in New Issue
Block a user