]> git.baikalelectronics.ru Git - kernel.git/commit
net/ipv4: Revert use of struct_size() helper
authorGustavo A. R. Silva <gustavoars@kernel.org>
Wed, 4 Aug 2021 18:23:25 +0000 (13:23 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Aug 2021 10:33:50 +0000 (11:33 +0100)
commitbfef41746072a183f70e9c20a437880831e4c415
treef8785c120867e39deba2cb4a9dd9934da24e59af
parent23ab8271b83e2be5c81e42c6f746a0f0c019254a
net/ipv4: Revert use of struct_size() helper

Revert the use of structr_size() and stay with IP_MSFILTER_SIZE() for
now, as in this case, the size of struct ip_msfilter didn't change with
the addition of the flexible array imsf_slist_flex[]. So, if we use
struct_size() we will be allocating and calculating the size of
struct ip_msfilter with one too many items for imsf_slist_flex[].

We might use struct_size() in the future, but for now let's stay
with IP_MSFILTER_SIZE().

Fixes: 325ee0c57a8b ("net/ipv4: Replace one-element array with flexible-array member")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/igmp.c
net/ipv4/ip_sockglue.c