netlink: fix IPv6 address updates (FS#2204)
authorHans Dedecker <dedeckeh@gmail.com>
Wed, 27 Mar 2019 15:55:19 +0000 (16:55 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Wed, 27 Mar 2019 16:07:26 +0000 (17:07 +0100)
Keep the valid and preferred lifetimes in sync with the kernel by always
updating the cached IPv6 addresses in refesh_iface_addr6().
This fixes invalid preferred and valid IA lifetimes in DHCPv6 reply
messages due to the cached preferred and valid lifetimes not being in
sync with the preferred and valid kernel lifetimes

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

index c6727482980225197179622a2970c75d0109c1ba..c3536e70e5d25eba7f2be822a7514adcc25958c3 100644 (file)
@@ -212,7 +212,9 @@ static void refresh_iface_addr6(int ifindex)
        }
 
        if (!change) {
-               free(addr);
+               free(iface->addr6);
+               iface->addr6 = addr;
+               iface->addr6_len = len;
                return;
        }