if (e)
return e->id;
- e = xmalloc(sizeof(struct identry));
+ e = xmalloc(sizeof(*e));
e->name = xstrdup(name);
e->id = nm->next_id++;
e->next = nm->cache->ent;
_("don't use `{' in the name of a counter: %s"),
spec_str);
- spec = xmalloc(sizeof(struct counter_spec));
+ spec = xmalloc(sizeof(*spec));
INIT_LIST_HEAD(&spec->specs);
spec->name = spec_str;
spec->expr = sep + 1;
if (interface == NULL)
return sd; /* Just making a socket */
- memset(&addr, 0, sizeof(struct sockaddr_ll));
+ memset(&addr, 0, sizeof(addr));
addr.sll_family = AF_PACKET;
addr.sll_ifindex = if_nametoindex(interface);
if (addr.sll_ifindex == 0) {
err(EXIT_FAILURE,
"failed to get the interface index for %s", interface);
}
- if (bind(sd, (struct sockaddr *)&addr, sizeof(struct sockaddr_ll)) < 0) {
+ if (bind(sd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
err(EXIT_FAILURE,
"failed to get the interface index for %s", interface);
}