int odhcpd_get_mac(const struct interface *iface, uint8_t mac[6])
{
struct ifreq ifr;
+ memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, iface->ifname, sizeof(ifr.ifr_name));
if (ioctl(ioctl_sock, SIOCGIFHWADDR, &ifr) < 0)
return -1;
uint8_t pad2;
uint32_t lifetime;
uint8_t name[];
- } *search = alloca(sizeof(*search) + search_padded);
+ } *search = malloc(sizeof(*search) + search_padded);
search->type = ND_OPT_DNS_SEARCH;
search->len = search_len ? ((sizeof(*search) + search_padded) / 8) : 0;
search->pad = 0;
struct sockaddr_in6 all_nodes = {AF_INET6, 0, 0, ALL_IPV6_NODES, 0};
odhcpd_send(router_event.uloop.fd,
&all_nodes, iov, ARRAY_SIZE(iov), iface);
+ free(search);
// Rearm timer
int msecs;