ipv6: introduce dst_rt6_info() helper
authorEric Dumazet <edumazet@google.com>
Fri, 26 Apr 2024 15:19:52 +0000 (15:19 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Apr 2024 12:32:01 +0000 (13:32 +0100)
commite8dfd42c17faf183415323db1ef0c977be0d6489
treec51745e2765effa88f3047a634efef44e00eebb1
parentfac87d32a092e0a987e3fb7a7821e2468e96f91c
ipv6: introduce dst_rt6_info() helper

Instead of (struct rt6_info *)dst casts, we can use :

 #define dst_rt6_info(_ptr) \
         container_of_const(_ptr, struct rt6_info, dst)

Some places needed missing const qualifiers :

ip6_confirm_neigh(), ipv6_anycast_destination(),
ipv6_unicast_destination(), has_gateway()

v2: added missing parts (David Ahern)

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
30 files changed:
drivers/infiniband/core/addr.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
drivers/net/vrf.c
drivers/net/vxlan/vxlan_core.c
drivers/s390/net/qeth_core.h
include/net/ip6_fib.h
include/net/ip6_route.h
net/bluetooth/6lowpan.c
net/core/dst_cache.c
net/core/filter.c
net/ipv4/ip_tunnel.c
net/ipv6/icmp.c
net/ipv6/ila/ila_lwt.c
net/ipv6/ip6_output.c
net/ipv6/ip6mr.c
net/ipv6/ndisc.c
net/ipv6/ping.c
net/ipv6/raw.c
net/ipv6/route.c
net/ipv6/tcp_ipv6.c
net/ipv6/udp.c
net/ipv6/xfrm6_policy.c
net/l2tp/l2tp_ip6.c
net/mpls/mpls_iptunnel.c
net/netfilter/ipvs/ip_vs_xmit.c
net/netfilter/nf_flow_table_core.c
net/netfilter/nf_flow_table_ip.c
net/netfilter/nft_rt.c
net/sctp/ipv6.c
net/xfrm/xfrm_policy.c