#include "common.h"
#include <asm/types.h>
-#include <sys/socket.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
{
ir_ignorelist_t *entry;
- entry = (ir_ignorelist_t *) malloc (sizeof (ir_ignorelist_t));
+ entry = calloc (1, sizeof (*entry));
if (entry == NULL)
return (-1);
- memset (entry, '\0', sizeof (ir_ignorelist_t));
-
if (strcasecmp (dev, "All") != 0)
{
entry->device = strdup (dev);
} /* void check_ignorelist_and_submit */
-#define COPY_RTNL_LINK_VALUE (dst_stats, src_stats, value_name) \
+#define COPY_RTNL_LINK_VALUE(dst_stats, src_stats, value_name) \
(dst_stats)->value_name = (src_stats)->value_name
-#define COPY_RTNL_LINK_STATS (dst_stats, src_stats) \
+#define COPY_RTNL_LINK_STATS(dst_stats, src_stats) \
COPY_RTNL_LINK_VALUE (dst_stats, src_stats, rx_packets); \
COPY_RTNL_LINK_VALUE (dst_stats, src_stats, tx_packets); \
COPY_RTNL_LINK_VALUE (dst_stats, src_stats, rx_bytes); \
const char *kind = NULL;
/* char *type_instance; */
- char *tc_type;
+ const char *tc_type;
char tc_inst[DATA_MAX_NAME_LEN];
_Bool stats_submitted = 0;
continue;
}
- DEBUG ("netlink plugin: ir_read: querying %s from %s (%lu).",
+ DEBUG ("netlink plugin: ir_read: querying %s from %s (%zu).",
type_name[type_index], iflist[ifindex], ifindex);
nlh = mnl_nlmsg_put_header (buf);