1370854b6b560624580eb41d909553d430b9360d
[openwrt/openwrt.git] /
1 From bb522bd584f05e6658d5dba97f48ca018f46394c Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Sat, 6 May 2017 14:36:08 +0200
4 Subject: [PATCH] src/nl_extras.h: fix compatibility with libnl 3.3.0
5
6 nl_extras.h defines a set of nla_set_s*() functions if not provided by
7 libnl. They are provided by libnl since version 3.2.26. The test
8 (LIBNL_VER_MIC <= 26) was working fine while libnl was in the 3.2.x
9 series, but now that they have incremented the minor version, the
10 micro version was reset to 0, with the latest libnl version being
11 3.3.0.
12
13 Due to this, the condition (LIBNL_VER_MIC <= 26) is true, and we get
14 redefinition errors because nl_extras.h redefines functions already
15 provided by libnl.
16
17 This commit improves the condition so that nl_extras.h provides the
18 missing functions only if the minor version is < 2, or if minor is 2
19 and micro is < 26.
20
21 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
22 ---
23 src/nl_extras.h | 4 ++--
24 1 file changed, 2 insertions(+), 2 deletions(-)
25
26 --- a/src/nl_extras.h
27 +++ b/src/nl_extras.h
28 @@ -1,7 +1,7 @@
29 #ifndef __NL_EXTRAS_H
30 #define __NL_EXTRAS_H
31
32 -#if LIBNL_VER_MIC <= 26
33 +#if (LIBNL_VER_MIN < 2) || (LIBNL_VER_MIN == 2) && (LIBNL_VER_MIC <= 26)
34
35 #ifndef NLA_S8
36
37 @@ -45,6 +45,6 @@ static inline int32_t nla_get_s32(struct
38
39 #endif /* NLA_S64 */
40
41 -#endif /* LIBNL_VER_MIC */
42 +#endif /* LIBNL_VER_* */
43
44 #endif /* __NL_EXTRAS_H */