ndp: use IPv4 address list when comparing IPv4 addresses
authorHans Dedecker <dedeckeh@gmail.com>
Wed, 16 Aug 2017 09:55:39 +0000 (11:55 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Wed, 16 Aug 2017 11:41:36 +0000 (13:41 +0200)
Use IPv4 address list in check_addr_updates which fixes possible segfault
as IPv6 address list was used by mistake.

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

index 8378ebff8eb135cad964f8e4ee5212f1daa70a78..33dde872f73e801ac8db8a1255aa186136fa02df 100644 (file)
--- a/src/ndp.c
+++ b/src/ndp.c
@@ -335,7 +335,7 @@ static void check_addr_updates(struct interface *iface)
 
        bool change = len != (ssize_t)iface->addr4_len;
        for (ssize_t i = 0; !change && i < len; ++i)
-               if (addr[i].addr.in.s_addr != iface->ia_addr[i].addr.in.s_addr)
+               if (addr[i].addr.in.s_addr != iface->addr4[i].addr.in.s_addr)
                        change = true;
 
        free(iface->addr4);