aboutsummaryrefslogtreecommitdiff
path: root/net/xfrm
diff options
context:
space:
mode:
authorGravatar Eric Dumazet <edumazet@google.com> 2024-04-26 15:19:52 +0000
committerGravatar David S. Miller <davem@davemloft.net> 2024-04-29 13:32:01 +0100
commite8dfd42c17faf183415323db1ef0c977be0d6489 (patch)
treec51745e2765effa88f3047a634efef44e00eebb1 /net/xfrm
parentMerge branch 'mlxsw-events-processing-performance' (diff)
downloadlinux-e8dfd42c17faf183415323db1ef0c977be0d6489.tar.gz
linux-e8dfd42c17faf183415323db1ef0c977be0d6489.tar.bz2
linux-e8dfd42c17faf183415323db1ef0c977be0d6489.zip
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>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_policy.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 6affe5cd85d8..1a41650d9d7b 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2598,8 +2598,7 @@ static void xfrm_init_path(struct xfrm_dst *path, struct dst_entry *dst,
int nfheader_len)
{
if (dst->ops->family == AF_INET6) {
- struct rt6_info *rt = (struct rt6_info *)dst;
- path->path_cookie = rt6_get_cookie(rt);
+ path->path_cookie = rt6_get_cookie(dst_rt6_info(dst));
path->u.rt6.rt6i_nfheader_len = nfheader_len;
}
}