summaryrefslogtreecommitdiff
path: root/net/psample
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-13 08:42:54 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-13 08:42:54 +0300
commitb37333c8657cfece16b2fb0ba3fef2cb481a0a19 (patch)
tree9b7da4fb461d74f6c5fd02b872a695af30cad324 /net/psample
parente7cd121cbf1bec05e50335f82d4aa7d8fa700538 (diff)
parent5bc55a333a2f7316b58edc7573e8e893f7acb532 (diff)
downloadlinux-b37333c8657cfece16b2fb0ba3fef2cb481a0a19.tar.xz
Merge 6.13-rc7 into staging next
We need the gpib changes in here as well to build on top of. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/psample')
-rw-r--r--net/psample/psample.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/psample/psample.c b/net/psample/psample.c
index a0ddae8a65f9..25f92ba0840c 100644
--- a/net/psample/psample.c
+++ b/net/psample/psample.c
@@ -393,7 +393,9 @@ void psample_sample_packet(struct psample_group *group,
nla_total_size_64bit(sizeof(u64)) + /* timestamp */
nla_total_size(sizeof(u16)) + /* protocol */
(md->user_cookie_len ?
- nla_total_size(md->user_cookie_len) : 0); /* user cookie */
+ nla_total_size(md->user_cookie_len) : 0) + /* user cookie */
+ (md->rate_as_probability ?
+ nla_total_size(0) : 0); /* rate as probability */
#ifdef CONFIG_INET
tun_info = skb_tunnel_info(skb);
@@ -498,8 +500,9 @@ void psample_sample_packet(struct psample_group *group,
md->user_cookie))
goto error;
- if (md->rate_as_probability)
- nla_put_flag(nl_skb, PSAMPLE_ATTR_SAMPLE_PROBABILITY);
+ if (md->rate_as_probability &&
+ nla_put_flag(nl_skb, PSAMPLE_ATTR_SAMPLE_PROBABILITY))
+ goto error;
genlmsg_end(nl_skb, data);
genlmsg_multicast_netns(&psample_nl_family, group->net, nl_skb, 0,