summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 25bf812)
raw | patch | inline | side by side (parent: 25bf812)
author | Andreas Henriksson <andreas@fatal.se> | |
Thu, 25 Jul 2013 20:26:32 +0000 (22:26 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Fri, 26 Jul 2013 07:36:35 +0000 (09:36 +0200) |
A reference to a pointer is passed as data,
the resulting attribute payload should be stored in
the dereferenced location to return it to the caller.
the resulting attribute payload should be stored in
the dereferenced location to return it to the caller.
src/netlink.c | patch | blob | history |
diff --git a/src/netlink.c b/src/netlink.c
index c0b60c2260087d0ee7ca566eed455e8b172dfcc1..aaac8c4b0a9682377db6edbece2fbc415457731e 100644 (file)
--- a/src/netlink.c
+++ b/src/netlink.c
#if HAVE_TCA_STATS2
static int qos_attr_cb (const struct nlattr *attr, void *data)
{
- struct gnet_stats_basic *bs = *(struct gnet_stats_basic **)data;
+ struct gnet_stats_basic **bs = (struct gnet_stats_basic **)data;
/* skip unsupported attribute in user-space */
if (mnl_attr_type_valid (attr, TCA_STATS_MAX) < 0)
if (mnl_attr_get_type (attr) == TCA_STATS_BASIC)
{
- if (mnl_attr_validate2 (attr, MNL_TYPE_UNSPEC, sizeof (*bs)) < 0)
+ if (mnl_attr_validate2 (attr, MNL_TYPE_UNSPEC, sizeof (**bs)) < 0)
{
ERROR ("netlink plugin: qos_attr_cb: TCA_STATS_BASIC mnl_attr_validate2 failed.");
return MNL_CB_ERROR;
}
- bs = mnl_attr_get_payload (attr);
+ *bs = mnl_attr_get_payload (attr);
return MNL_CB_STOP;
}