Message ID | 20170312230151.5185-11-hannes@stressinduktion.org |
---|---|
State | RFC, archived |
Delegated to: | David Miller |
Headers | show |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index eb1b662f62626f..01cbcfe93383b7 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h @@ -180,6 +180,17 @@ static __inline__ bool inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) return !((addr^ifa->ifa_address)&ifa->ifa_mask); } +static inline struct afnetns *ifa_find_afnetns_rcu(struct net *net, __be32 addr) +{ +#if IS_ENABLED(CONFIG_AFNETNS) + struct in_ifaddr *ifa = ifa_find_rcu(net, addr); + + return ifa ? ifa->afnetns : net->afnet_ns; +#else + return NULL; +#endif +} + /* * Check if a mask is acceptable. */
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> --- include/linux/inetdevice.h | 11 +++++++++++ 1 file changed, 11 insertions(+)