Skip to content
Commit a97788b8 authored by Eric Dumazet's avatar Eric Dumazet Committed by Greg Kroah-Hartman
Browse files

inet: introduce dst_rtable() helper

[ Upstream commit 05d6d492 ]

I added dst_rt6_info() in commit
e8dfd42c

 ("ipv6: introduce dst_rt6_info() helper")

This patch does a similar change for IPv4.

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

 #define dst_rtable(_ptr) \
             container_of_const(_ptr, struct rtable, dst)

Patch is smaller than IPv6 one, because IPv4 has skb_rtable() helper.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Reviewed-by: default avatarSabrina Dubroca <sd@queasysnail.net>
Link: https://lore.kernel.org/r/20240429133009.1227754-1-edumazet@google.com
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Stable-dep-of: 92f1655a

 ("net: fix __dst_negative_advice() race")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 30c83ed5
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment