The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] ipv6: fix rt6_fill_node() multicast route query handling
@ 2026-11-12  9:46 Wenbo Sun
  2026-11-12  9:46 ` [PATCH net-next v2 1/2] ipv6: check mc_forwarding before calling ip6mr_get_route() Wenbo Sun
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Wenbo Sun @ 2026-11-12  9:46 UTC (permalink / raw)
  To: David Ahern, Ido Schimmel, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Hangbin Liu, Hangbin Liu, netdev, linux-kernel,
	sunwenbo, 1342116488

When querying an IPv6 multicast route with an input interface via
"ip -6 route get <mcast_addr> from <src_addr> iif <dev>", rt6_fill_node()
currently calls ip6mr_get_route() unconditionally and masks any negative
error returned by ip6mr_get_route() with -EMSGSIZE at nla_put_failure.

Patch 1 checks mc_forwarding before calling ip6mr_get_route(), matching
IPv4 rt_fill_info() so queries succeed with RTA_IIF when multicast
routing is disabled. Patch 2 preserves the negative error returned by
ip6mr_get_route() instead of overwriting it with -EMSGSIZE when
multicast forwarding is enabled.

Thanks to Hangbin Liu for reviewing v1 and pointing out the error
masking issue in rt6_fill_node().

Changes in v2:
- Reword patch 1 commit message for clearer tone and carry
  Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>.
- Add patch 2 to preserve negative errors returned by ip6mr_get_route()
  instead of returning -EMSGSIZE from nla_put_failure, with
  Suggested-by: Hangbin Liu <liuhangbin@kylinos.cn>.
- Verify both mc_forwarding=0 and mc_forwarding=1 (MRT6_INIT) cases in
  a UML kernel alongside W=1 builds on UML, x86_64 allmodconfig, and
  x86_64 allyesconfig.

Link: https://lore.kernel.org/netdev/20261111094528.425826-1-sunwenbo@cmss.chinamobile.com/ [v1]

Wenbo Sun (2):
  ipv6: check mc_forwarding before calling ip6mr_get_route()
  ipv6: preserve ip6mr_get_route() error in rt6_fill_node()

 net/ipv6/route.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

-- 
2.33.0




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-13  2:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12  9:46 [PATCH net-next v2 0/2] ipv6: fix rt6_fill_node() multicast route query handling Wenbo Sun
2026-11-12  9:46 ` [PATCH net-next v2 1/2] ipv6: check mc_forwarding before calling ip6mr_get_route() Wenbo Sun
2026-11-12  9:46 ` [PATCH net-next v2 2/2] ipv6: preserve ip6mr_get_route() error in rt6_fill_node() Wenbo Sun
2026-11-13  2:29 ` [PATCH net-next v2 0/2] ipv6: fix rt6_fill_node() multicast route query handling Hangbin Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox