ip6mr: Use MAXMIFS in mr6_msgsize().
authorKuniyuki Iwashima <kuniyu@google.com>
Thu, 4 Jun 2026 22:46:21 +0000 (22:46 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 9 Jun 2026 00:06:22 +0000 (17:06 -0700)
commit36be7d7c5ded0d70c3384e4730664e25b8d076fc
tree381e6dbf94209c67b230a30bf87154aae6c87aac
parent364568de4e7f8a5a0f0e12a0ba8812377f53c07a
ip6mr: Use MAXMIFS in mr6_msgsize().

mr6_msgsize() calculates skb size needed for ip6mr_fill_mroute().

The size differs based on mrt->maxvif.

We will drop RTNL for ip6mr_rtm_getroute() and mrt->maxvif may
change under RCU.

To avoid -EMSGSIZE, let's calculate the size with the maximum
value of mrt->maxvif, MAXMIFS.

struct rtnexthop is 8 bytes and MAXMIFS is 32, so the maximum delta
is 256 bytes, which is small enough.

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260604224712.3209821-4-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/ip6mr.c