From 2ff654acbfa1ba9fe761ea6f0dbf6fcd6701ea33 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 6 Aug 2012 20:13:47 +0000 Subject: [PATCH] Add pltime and vltime to our IPv6 addresses. --- if-linux.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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); -- 2.47.3