summaryrefslogtreecommitdiffstats
path: root/include/netlink
diff options
context:
space:
mode:
authorPrzemyslaw Szczerbik <przemekszczerbik@gmail.com>2016-02-25 18:01:20 (GMT)
committerThomas Haller <thaller@redhat.com>2016-02-25 18:42:56 (GMT)
commitcdf2d4baf376e4a3030a2c1169516358b4fba2e5 (patch)
treef5a244c957e0e71fa0c77a4333172ec4ac71f52b /include/netlink
parente03e9ff88a29265cd876750258824b3e08351848 (diff)
downloadlibnl-cdf2d4baf376e4a3030a2c1169516358b4fba2e5.zip
libnl-cdf2d4baf376e4a3030a2c1169516358b4fba2e5.tar.gz
libnl-cdf2d4baf376e4a3030a2c1169516358b4fba2e5.tar.bz2
lib: add type casting for nla_for_each_nested macro
g++ is unable to compile code with nla_for_each_nested macro due to implicit type conversion from void* to nlattr*. This patch adds type casting for nla_for_each_nested macro to address this issue. Signed-off-by: Przemyslaw Szczerbik <przemek.szczerbik@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com> http://lists.infradead.org/pipermail/libnl/2016-February/002095.html
Diffstat (limited to 'include/netlink')
-rw-r--r--include/netlink/attr.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/netlink/attr.h b/include/netlink/attr.h
index ee159aa..e941a1a 100644
--- a/include/netlink/attr.h
+++ b/include/netlink/attr.h
@@ -325,7 +325,7 @@ extern int nla_is_nested(const struct nlattr *);
* @arg rem initialized to len, holds bytes currently remaining in stream
*/
#define nla_for_each_nested(pos, nla, rem) \
- for (pos = nla_data(nla), rem = nla_len(nla); \
+ for (pos = (struct nlattr *) nla_data(nla), rem = nla_len(nla); \
nla_ok(pos, rem); \
pos = nla_next(pos, &(rem)))