From: Roy Marples Date: Mon, 6 Aug 2012 20:13:47 +0000 (+0000) Subject: Add pltime and vltime to our IPv6 addresses. X-Git-Tag: v5.6.2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ff654acbfa1ba9fe761ea6f0dbf6fcd6701ea33;p=thirdparty%2Fdhcpcd.git Add pltime and vltime to our IPv6 addresses. --- diff --git a/if-linux.c b/if-linux.c index eaf60c65..d9db786d 100644 --- a/if-linux.c +++ b/if-linux.c @@ -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);