]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ipv6: fix _DEVADD() and _DEVUPD() macros
authorEric Dumazet <edumazet@google.com>
Wed, 19 Mar 2025 21:25:16 +0000 (21:25 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 25 Mar 2025 14:31:24 +0000 (07:31 -0700)
commitb709857ecbf511bb25603790ff9c3f12abe36559
tree110268c875534b5d4826b6919299e41b2f7cdfba
parent4a5524a2f7607c323229bdc69b12cac96546ecae
ipv6: fix _DEVADD() and _DEVUPD() macros

ip6_rcv_core() is using:

__IP6_ADD_STATS(net, idev,
IPSTATS_MIB_NOECTPKTS +
(ipv6_get_dsfield(hdr) & INET_ECN_MASK),
max_t(unsigned short, 1, skb_shinfo(skb)->gso_segs));

This is currently evaluating both expressions twice.

Fix _DEVADD() and _DEVUPD() macros to evaluate their arguments once.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250319212516.2385451-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/ipv6.h