]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: Avoid sizeof on flexible structure
authorSven Eckelmann <sven@narfation.org>
Tue, 29 Dec 2020 08:24:21 +0000 (09:24 +0100)
committerSimon Wunderlich <sw@simonwunderlich.de>
Sat, 6 Feb 2021 08:22:44 +0000 (09:22 +0100)
commit735c308a6b183b7c2d00614e64aab69e37d5ac64
tree628aef9b44ca5e9745cde8eab26d72f7c8b4266d
parent8327f376e93338736b41c7744d882cbdf3a166bc
batman-adv: Avoid sizeof on flexible structure

The batadv_dhcp_packet is used to read in parts of the DHCP packet and
extract relevant information for the distributed arp table. But the
structure contained the flexible member "options" which is no where used in
the code.

A sizeof on this kind of type would return the size of everything except
the flexible member. But sparse will detect this kind of sizeof and warn
with

  warning: using sizeof on a flexible structure

This can be avoided by dropping the unused flexible member.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/distributed-arp-table.c