aboutsummaryrefslogtreecommitdiffstats
path: root/net/psample/psample.c
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2024-12-05 19:48:58 +0000
committerJakub Kicinski <[email protected]>2024-12-19 19:35:07 +0000
commit07e5c4eb94e6aba96fa11b424b39c5e5576a7713 (patch)
treeab7c48de9389e6e3c30586630b19ead62ae43637 /net/psample/psample.c
parentMerge branch 'net-fib_rules-add-flow-label-selector-support' (diff)
parentMerge tag 'net-6.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/net... (diff)
downloadkernel-07e5c4eb94e6aba96fa11b424b39c5e5576a7713.tar.gz
kernel-07e5c4eb94e6aba96fa11b424b39c5e5576a7713.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR (net-6.13-rc4). No conflicts. Adjacent changes: drivers/net/ethernet/renesas/rswitch.h 32fd46f5b69e ("net: renesas: rswitch: remove speed from gwca structure") 922b4b955a03 ("net: renesas: rswitch: rework ts tags management") Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/psample/psample.c')
-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,