]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Add pltime and vltime to our IPv6 addresses.
authorRoy Marples <roy@marples.name>
Mon, 6 Aug 2012 20:13:47 +0000 (20:13 +0000)
committerRoy Marples <roy@marples.name>
Mon, 6 Aug 2012 20:13:47 +0000 (20:13 +0000)
if-linux.c

index eaf60c65f1a2b93ae94d7fc67fe48e28f1214375..d9db786d8bb03f05137162a4b2fd319f373aa1b8 100644 (file)
@@ -589,6 +589,7 @@ int
 if_address6(const struct interface *ifp, const struct ipv6_addr *ap, int action)
 {
        struct nlma *nlm;
+       struct ifa_cacheinfo cinfo;
        int retval = 0;
 
        nlm = xzalloc(sizeof(*nlm));
@@ -608,6 +609,14 @@ if_address6(const struct interface *ifp, const struct ipv6_addr *ap, int action)
        add_attr_l(&nlm->hdr, sizeof(*nlm), IFA_LOCAL,
            &ap->addr.s6_addr, sizeof(ap->addr.s6_addr));
 
+       if (action >= 0) {
+               memset(&cinfo, 0, sizeof(cinfo));
+               cinfo.ifa_prefered = ap->prefix_pltime;
+               cinfo.ifa_valid = ap->prefix_vltime;
+               add_attr_l(&nlm->hdr, sizeof(*nlm), IFA_CACHEINFO,
+                   &cinfo, sizeof(cinfo));
+       }
+
        if (send_netlink(&nlm->hdr) == -1)
                retval = -1;
        free(nlm);