summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3d046b8)
raw | patch | inline | side by side (parent: 3d046b8)
author | Andreas Henriksson <andreas@fatal.se> | |
Mon, 10 Jun 2013 20:56:54 +0000 (22:56 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Thu, 18 Jul 2013 10:04:23 +0000 (12:04 +0200) |
src/netlink.c | patch | blob | history |
diff --git a/src/netlink.c b/src/netlink.c
index 40b12e1b048c4861c408a8af51e9df3415d900c1..5aaa25bd3c3d9b43c5de51f183c110cd2215e950 100644 (file)
--- a/src/netlink.c
+++ b/src/netlink.c
plugin_dispatch_values (&vl);
} /* void submit_two */
-static int update_iflist(struct ifinfomsg *msg)
+static int update_iflist(struct ifinfomsg *msg, const char *dev)
{
/* Update the `iflist'. It's used to know which interfaces exist and query
* them later for qdiscs and classes. */
}
dev = mnl_attr_get_str (attr);
- if (update_iflist (ifm) < 0)
+ if (update_iflist (ifm, dev) < 0)
return MNL_CB_ERROR;
break;
}
return MNL_CB_OK;
} /* int link_filter_cb */
+#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;
return MNL_CB_OK;
} /* qos_attr_cb */
+#endif
-static int qos_filter_cb (constr struct nlmsghdr *nlh, void *args)
+static int qos_filter_cb (const struct nlmsghdr *nlh, void *args)
{
struct tcmsg *tm = mnl_nlmsg_get_payload(nlh);
+ struct nlattr *attr;
+
int wanted_ifindex = *((int *) args);
const char *dev;
return MNL_CB_ERROR;
}
- dev = iflist[msg->tcm_ifindex];
+ dev = iflist[tm->tcm_ifindex];
if (dev == NULL)
{
ERROR ("netlink plugin: qos_filter_cb: iflist[%i] == NULL",
- msg->tcm_ifindex);
+ tm->tcm_ifindex);
return MNL_CB_ERROR;
}
int ret;
unsigned int seq, portid;
+ size_t ifindex;
+
static const int type_id[] = { RTM_GETQDISC, RTM_GETTCLASS, RTM_GETTFILTER };
static const char *type_name[] = { "qdisc", "class", "filter" };
/* `link_filter_cb' will update `iflist' which is used here to iterate
* over all interfaces. */
- for (ifindex = 0; (size_t) ifindex < iflist_len; ifindex++)
+ for (ifindex = 0; ifindex < iflist_len; ifindex++)
{
struct tcmsg *tm;
int ifindex;