int ret = -1;
struct ifreq ifr = {};
struct ethtool_perm_addr *epaddr =
- calloc(sizeof(struct ethtool_perm_addr) + ETHER_ADDR_LEN, 1);
+ calloc(1, sizeof(struct ethtool_perm_addr) + ETHER_ADDR_LEN);
if (epaddr == NULL) goto end;
strlcpy(ifr.ifr_name, iface->name, sizeof(ifr.ifr_name));
#ifdef ENABLE_DOT3
# define ETHTOOL_LINK_MODE_MASK_MAX_KERNEL_NU32 (SCHAR_MAX)
# define ETHTOOL_DECLARE_LINK_MODE_MASK(name) \
- uint32_t name[ETHTOOL_LINK_MODE_MASK_MAX_KERNEL_NU32]
+ uint32_t name[ETHTOOL_LINK_MODE_MASK_MAX_KERNEL_NU32]
struct ethtool_link_usettings {
struct ethtool_link_settings base;
iff->upper_idx = -1;
for (attribute = IFLA_RTA(ifi); RTA_OK(attribute, len);
- attribute = RTA_NEXT(attribute, len)) {
+ attribute = RTA_NEXT(attribute, len)) {
switch (attribute->rta_type) {
case IFLA_IFNAME:
/* Interface name */
}
for (attribute = IFA_RTA(ifi); RTA_OK(attribute, len);
- attribute = RTA_NEXT(attribute, len)) {
+ attribute = RTA_NEXT(attribute, len)) {
switch (attribute->rta_type) {
case IFA_ADDRESS:
/* Address */
}
for (msg = (struct nlmsghdr *)(void *)(iov.iov_base);
- NLMSG_OK(msg, len); msg = NLMSG_NEXT(msg, len)) {
+ NLMSG_OK(msg, len); msg = NLMSG_NEXT(msg, len)) {
if (!(msg->nlmsg_flags & NLM_F_MULTI)) end = 1;
switch (msg->nlmsg_type) {
case NLMSG_DONE:
if (cfg->g_netlink) return 0;
log_debug("netlink", "initialize netlink subsystem");
- if ((cfg->g_netlink = calloc(sizeof(struct lldpd_netlink), 1)) == NULL) {
+ if ((cfg->g_netlink = calloc(1, sizeof(struct lldpd_netlink))) == NULL) {
log_warn("netlink", "unable to allocate memory for netlink subsystem");
goto end;
}