]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
psample: adjust size if rate_as_probability is set
authorAdrian Moreno <amorenoz@redhat.com>
Tue, 17 Dec 2024 11:37:39 +0000 (12:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Dec 2024 13:02:06 +0000 (14:02 +0100)
commit98031a6992c97ced0b06deb6ba6653d1369c8849
treeb5c7782516d0060af8af057a068a0081b1733710
parent57ed6505ba70ff55216c4c27ae1cb382c88fdd64
psample: adjust size if rate_as_probability is set

[ Upstream commit 5eecd85c77a254a43bde3212da8047b001745c9f ]

If PSAMPLE_ATTR_SAMPLE_PROBABILITY flag is to be sent, the available
size for the packet data has to be adjusted accordingly.

Also, check the error code returned by nla_put_flag.

Fixes: 7b1b2b60c63f ("net: psample: allow using rate as probability")
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Reviewed-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20241217113739.3929300-1-amorenoz@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/psample/psample.c