From 14eec9e7793b32c014c80c486582866574b37e2d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 4 Mar 2021 11:30:53 +0100 Subject: [PATCH] ANDROID: GKI: bring back icmpv6_send In 5.4.102 the icmpv6_send() was replaced with an inline function. Bring it back to provide for modules that used this symbol to preserve the ABI. Bug: 161946584 Signed-off-by: Greg Kroah-Hartman Change-Id: Id1a914518f6e850f6bb96b5449c15eda3a7a7fd8 --- include/linux/icmpv6.h | 5 +---- net/ipv6/ip6_icmp.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index 0be0d68fbb00..1121a623516c 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h @@ -44,10 +44,7 @@ extern int inet6_register_icmp_sender(ip6_icmp_send_t *fn); extern int inet6_unregister_icmp_sender(ip6_icmp_send_t *fn); #endif -static inline void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info) -{ - __icmpv6_send(skb, type, code, info, IP6CB(skb)); -} +void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info); int ip6_err_gen_icmpv6_unreach(struct sk_buff *skb, int nhs, int type, unsigned int data_len); diff --git a/net/ipv6/ip6_icmp.c b/net/ipv6/ip6_icmp.c index 9e3574880cb0..d779716f508b 100644 --- a/net/ipv6/ip6_icmp.c +++ b/net/ipv6/ip6_icmp.c @@ -47,6 +47,18 @@ void __icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info, EXPORT_SYMBOL(__icmpv6_send); #endif +/* + * ANDROID API HACK for android11-5.4 branch only + * + * Work around loss of icmpv6_send global symbol that got moved to __icmpv6_send + * in 5.4.102 + */ +void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info) +{ + __icmpv6_send(skb, type, code, info, IP6CB(skb)); +} +EXPORT_SYMBOL(icmpv6_send); + #if IS_ENABLED(CONFIG_NF_NAT) #include void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u32 info)