diff options
author | Przemyslaw Szczerbik <przemekszczerbik@gmail.com> | 2016-02-25 18:01:20 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-02-25 18:42:56 (GMT) |
commit | cdf2d4baf376e4a3030a2c1169516358b4fba2e5 (patch) | |
tree | f5a244c957e0e71fa0c77a4333172ec4ac71f52b | |
parent | e03e9ff88a29265cd876750258824b3e08351848 (diff) | |
download | libnl-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
-rw-r--r-- | include/netlink/attr.h | 2 |
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))) |