dhcpv6: initialize ifreq struct
authorHans Dedecker <dedeckeh@gmail.com>
Tue, 27 Mar 2018 19:00:08 +0000 (21:00 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Tue, 27 Mar 2018 19:00:08 +0000 (21:00 +0200)
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/dhcpv6.c

index 4728d896f488fd05f9fc82e925f54b2024fbd193..f98819ef5cf20c290fcbeec524dc03880366470e 100644 (file)
@@ -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;