diff options
author | Eric Dumazet <edumazet@google.com> | 2024-04-29 15:30:09 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-05-01 03:32:38 +0200 |
commit | 05d6d492097c55f2d153fc3fd33cbe78e1e28e0a (patch) | |
tree | 9adf856d1bf6bece623d78a5f6412ec337927ec5 /net/tipc | |
parent | Merge branch 'selftests-net-page_poll-allocation-error-injection' (diff) | |
download | linux-05d6d492097c55f2d153fc3fd33cbe78e1e28e0a.tar.xz linux-05d6d492097c55f2d153fc3fd33cbe78e1e28e0a.zip |
inet: introduce dst_rtable() helper
I added dst_rt6_info() in commit
e8dfd42c17fa ("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: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://lore.kernel.org/r/20240429133009.1227754-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/udp_media.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c index f892b0903dba..b849a3d133a0 100644 --- a/net/tipc/udp_media.c +++ b/net/tipc/udp_media.c @@ -174,7 +174,7 @@ static int tipc_udp_xmit(struct net *net, struct sk_buff *skb, local_bh_disable(); ndst = dst_cache_get(cache); if (dst->proto == htons(ETH_P_IP)) { - struct rtable *rt = (struct rtable *)ndst; + struct rtable *rt = dst_rtable(ndst); if (!rt) { struct flowi4 fl = { |