From: Hans Dedecker Date: Tue, 27 Mar 2018 19:00:08 +0000 (+0200) Subject: dhcpv6: initialize ifreq struct X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b7b11cbe08040dd24f07d34dbaed1d70537400bc;p=oweals%2Fodhcp6c.git dhcpv6: initialize ifreq struct Signed-off-by: Hans Dedecker --- diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 4728d89..f98819e 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -134,6 +134,7 @@ int init_dhcpv6(const char *ifname, unsigned int options, int sol_timeout) // Detect interface struct ifreq ifr; + memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); if (ioctl(sock, SIOCGIFINDEX, &ifr) < 0) return -1;