diff options
| author | Eric Dumazet <[email protected]> | 2024-04-29 13:30:09 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-05-01 01:32:38 +0000 |
| commit | 05d6d492097c55f2d153fc3fd33cbe78e1e28e0a (patch) | |
| tree | 9adf856d1bf6bece623d78a5f6412ec337927ec5 /net/core/dst_cache.c | |
| parent | Merge branch 'selftests-net-page_poll-allocation-error-injection' (diff) | |
| download | kernel-05d6d492097c55f2d153fc3fd33cbe78e1e28e0a.tar.gz kernel-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 <[email protected]>
Reviewed-by: David Ahern <[email protected]>
Reviewed-by: Sabrina Dubroca <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/core/dst_cache.c')
| -rw-r--r-- | net/core/dst_cache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/dst_cache.c b/net/core/dst_cache.c index b17171345d64..0c0bdb058c5b 100644 --- a/net/core/dst_cache.c +++ b/net/core/dst_cache.c @@ -83,7 +83,7 @@ struct rtable *dst_cache_get_ip4(struct dst_cache *dst_cache, __be32 *saddr) return NULL; *saddr = idst->in_saddr.s_addr; - return container_of(dst, struct rtable, dst); + return dst_rtable(dst); } EXPORT_SYMBOL_GPL(dst_cache_get_ip4); |
