hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/net/ipv6/route.c
....@@ -5401,16 +5401,17 @@
54015401 nexthop_for_each_fib6_nh(f6i->nh, rt6_nh_nlmsg_size,
54025402 &nexthop_len);
54035403 } else {
5404
+ struct fib6_info *sibling, *next_sibling;
54045405 struct fib6_nh *nh = f6i->fib6_nh;
54055406
54065407 nexthop_len = 0;
54075408 if (f6i->fib6_nsiblings) {
5408
- nexthop_len = nla_total_size(0) /* RTA_MULTIPATH */
5409
- + NLA_ALIGN(sizeof(struct rtnexthop))
5410
- + nla_total_size(16) /* RTA_GATEWAY */
5411
- + lwtunnel_get_encap_size(nh->fib_nh_lws);
5409
+ rt6_nh_nlmsg_size(nh, &nexthop_len);
54125410
5413
- nexthop_len *= f6i->fib6_nsiblings;
5411
+ list_for_each_entry_safe(sibling, next_sibling,
5412
+ &f6i->fib6_siblings, fib6_siblings) {
5413
+ rt6_nh_nlmsg_size(sibling->fib6_nh, &nexthop_len);
5414
+ }
54145415 }
54155416 nexthop_len += lwtunnel_get_encap_size(nh->fib_nh_lws);
54165417 }