continue;
if(owner && cache_mac_subnet[i] && cache_mac_subnet[i]->owner != owner)
continue;
- if(!memcmp(address, &cache_mac_address[i], sizeof *address))
+ if(!memcmp(address, &cache_mac_address[i], sizeof(*address)))
return cache_mac_subnet[i];
}
if(!p || p->type != SUBNET_MAC)
continue;
- if(!memcmp(address, &p->net.mac.address, sizeof *address)) {
+ if(!memcmp(address, &p->net.mac.address, sizeof(*address))) {
r = p;
if(p->owner->status.reachable)
break;
// Cache the result
cache_mac_slot = !cache_mac_slot;
- memcpy(&cache_mac_address[cache_mac_slot], address, sizeof *address);
+ memcpy(&cache_mac_address[cache_mac_slot], address, sizeof(*address));
cache_mac_subnet[cache_mac_slot] = r;
cache_mac_valid[cache_mac_slot] = true;
for(i = 0; i < 2; i++) {
if(!cache_ipv4_valid[i])
continue;
- if(!memcmp(address, &cache_ipv4_address[i], sizeof *address))
+ if(!memcmp(address, &cache_ipv4_address[i], sizeof(*address)))
return cache_ipv4_subnet[i];
}
// Cache the result
cache_ipv4_slot = !cache_ipv4_slot;
- memcpy(&cache_ipv4_address[cache_ipv4_slot], address, sizeof *address);
+ memcpy(&cache_ipv4_address[cache_ipv4_slot], address, sizeof(*address));
cache_ipv4_subnet[cache_ipv4_slot] = r;
cache_ipv4_valid[cache_ipv4_slot] = true;
for(i = 0; i < 2; i++) {
if(!cache_ipv6_valid[i])
continue;
- if(!memcmp(address, &cache_ipv6_address[i], sizeof *address))
+ if(!memcmp(address, &cache_ipv6_address[i], sizeof(*address)))
return cache_ipv6_subnet[i];
}
// Cache the result
cache_ipv6_slot = !cache_ipv6_slot;
- memcpy(&cache_ipv6_address[cache_ipv6_slot], address, sizeof *address);
+ memcpy(&cache_ipv6_address[cache_ipv6_slot], address, sizeof(*address));
cache_ipv6_subnet[cache_ipv6_slot] = r;
cache_ipv6_valid[cache_ipv6_slot] = true;
if(!subnet) {
for(node = owner->subnet_tree->head; node; node = node->next) {
subnet = node->data;
- if(!net2str(netstr, sizeof netstr, subnet))
+ if(!net2str(netstr, sizeof(netstr), subnet))
continue;
// Strip the weight from the subnet, and put it in its own environment variable
char *weight = strchr(netstr, '#');
execute_script(name, envp);
}
} else {
- if(net2str(netstr, sizeof netstr, subnet)) {
+ if(net2str(netstr, sizeof(netstr), subnet)) {
// Strip the weight from the subnet, and put it in its own environment variable
char *weight = strchr(netstr, '#');
if(weight)
for(node = subnet_tree->head; node; node = node->next) {
subnet = node->data;
- if(!net2str(netstr, sizeof netstr, subnet))
+ if(!net2str(netstr, sizeof(netstr), subnet))
continue;
logger(LOG_DEBUG, " %s owner %s", netstr, subnet->owner->name);
}