dhcpv6-ia: fix compiler warning
authorHans Dedecker <dedeckeh@gmail.com>
Wed, 16 Jan 2019 21:40:46 +0000 (22:40 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Wed, 16 Jan 2019 21:45:51 +0000 (22:45 +0100)
Fixes :

src/dhcpv6-ia.c:1117:22: warning: variable 'onlink' set but not used [-Wunused-but-set-variable]
   for (size_t i = 0, onlink = false; i < addrlen; ++i) {

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/dhcpv6-ia.c

index c72c4b453eb60422d53aacae8ab1e09e331d3141..83de0a29f5faf6f5a0c3a554ab3cc99b4a049acd 100644 (file)
@@ -1114,7 +1114,8 @@ static bool dhcpv6_ia_on_link(const struct dhcpv6_ia_hdr *ia, struct dhcpv6_assi
                                (otype != DHCPV6_OPT_IA_ADDR || olen < sizeof(*n) - 4))
                        continue;
 
-               for (size_t i = 0, onlink = false; i < addrlen; ++i) {
+               onlink = false;
+               for (size_t i = 0; i < addrlen; ++i) {
                        struct in6_addr addr = addrs[i].addr.in6;
 
                        if (!valid_addr(&addrs[i], now))