diff options
author | Shay Bar <shay.bar@celeno.com> | 2020-11-10 16:03:44 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2020-11-30 23:47:55 +0100 |
commit | 2df1e3fce05f57df7796f6ce35fa40bdc9325fc8 (patch) | |
tree | bfbb9c5d4ad2355fece32ad7839243a60c4a7ed8 | |
parent | fb0ccf6f24adb2b57805bbe7fe6a1fcf5f8999c3 (diff) | |
download | backports-2df1e3fce05f57df7796f6ce35fa40bdc9325fc8.tar.gz |
backports: Add time64_to_tm and ipv6_mc_check_mld
ipv6_mc_check_mld() was added in kernel version 4.2.0.
The 2nd parameter was removed in kernel version 5.1.0.
time64_to_tm() was added in kernel version 4.8.0.
Signed-off-by: Shay Bar <shay.bar@celeno.com>
-rw-r--r-- | backport/backport-include/linux/time.h | 8 | ||||
-rw-r--r-- | backport/backport-include/net/addrconf.h | 15 |
2 files changed, 23 insertions, 0 deletions
diff --git a/backport/backport-include/linux/time.h b/backport/backport-include/linux/time.h index 3191047d..ce8a1b03 100644 --- a/backport/backport-include/linux/time.h +++ b/backport/backport-include/linux/time.h @@ -4,4 +4,12 @@ #include <linux/time64.h> +#if LINUX_VERSION_IS_LESS(4,8,0) +static inline void time64_to_tm(time64_t totalsecs, int offset, + struct tm *result) +{ + time_to_tm((time_t)totalsecs, 0, result); +} +#endif + #endif /* __BACKPORT_LINUX_TIME_H */ diff --git a/backport/backport-include/net/addrconf.h b/backport/backport-include/net/addrconf.h index f1e8e627..67d44e19 100644 --- a/backport/backport-include/net/addrconf.h +++ b/backport/backport-include/net/addrconf.h @@ -22,4 +22,19 @@ static inline bool ipv6_addr_is_solict_mult(const struct in6_addr *addr) } #endif /* LINUX_VERSION_IS_LESS(3,9,0) */ +#if LINUX_VERSION_IS_LESS(4,2,0) +static inline int ipv6_mc_check_mld(struct sk_buff *skb) +{ + WARN_ON(1); + + return -1; +} +#elif LINUX_VERSION_IS_LESS(5,1,0) +static inline int backport_ipv6_mc_check_mld(struct sk_buff *skb) +{ + return ipv6_mc_check_mld(skb, NULL); +} +#define ipv6_mc_check_mld LINUX_BACKPORT(ipv6_mc_check_mld) +#endif + #endif /* _BACKPORT_NET_ADDRCONF_H */ |