Lines 223-229
static int link_filter (const struct soc
Link Here
|
223 |
|
223 |
|
224 |
msg = NLMSG_DATA (nmh); |
224 |
msg = NLMSG_DATA (nmh); |
225 |
|
225 |
|
226 |
msg_len = nmh->nlmsg_len - sizeof (struct ifinfomsg); |
226 |
msg_len = nmh->nlmsg_len - NLMSG_LENGTH(sizeof (struct ifinfomsg)); |
227 |
if (msg_len < 0) |
227 |
if (msg_len < 0) |
228 |
{ |
228 |
{ |
229 |
ERROR ("netlink plugin: link_filter: msg_len = %i < 0;", msg_len); |
229 |
ERROR ("netlink plugin: link_filter: msg_len = %i < 0;", msg_len); |
Lines 554-570
static int ir_init (void)
Link Here
|
554 |
|
554 |
|
555 |
static int ir_read (void) |
555 |
static int ir_read (void) |
556 |
{ |
556 |
{ |
557 |
struct ifinfomsg im; |
|
|
558 |
struct tcmsg tm; |
557 |
struct tcmsg tm; |
559 |
int ifindex; |
558 |
int ifindex; |
560 |
|
559 |
|
561 |
static const int type_id[] = { RTM_GETQDISC, RTM_GETTCLASS, RTM_GETTFILTER }; |
560 |
static const int type_id[] = { RTM_GETQDISC, RTM_GETTCLASS, RTM_GETTFILTER }; |
562 |
static const char *type_name[] = { "qdisc", "class", "filter" }; |
561 |
static const char *type_name[] = { "qdisc", "class", "filter" }; |
563 |
|
562 |
|
564 |
memset (&im, '\0', sizeof (im)); |
563 |
if (rtnl_wilddump_request (&rth, AF_UNSPEC, RTM_GETLINK) < 0) |
565 |
im.ifi_type = AF_UNSPEC; |
|
|
566 |
|
567 |
if (rtnl_dump_request (&rth, RTM_GETLINK, &im, sizeof (im)) < 0) |
568 |
{ |
564 |
{ |
569 |
ERROR ("netlink plugin: ir_read: rtnl_dump_request failed."); |
565 |
ERROR ("netlink plugin: ir_read: rtnl_dump_request failed."); |
570 |
return (-1); |
566 |
return (-1); |