int index;
struct ether_addr mac_addr;
uint32_t mtu;
+ ICMP6Prefix *expired_prefix;
LIST_HEAD(ICMP6Prefix, prefixes);
int fd;
sd_event_source *recv;
LIST_REMOVE(prefixes, nd->prefixes, prefix);
+ nd->expired_prefix = prefix;
icmp6_nd_notify(nd,
ICMP6_EVENT_ROUTER_ADVERTISMENT_PREFIX_EXPIRED);
+ nd->expired_prefix = NULL;
+
prefix = icmp6_prefix_unref(prefix);
break;
return 0;
}
+int sd_icmp6_ra_get_expired_prefix(sd_icmp6_nd *nd, struct in6_addr **addr,
+ uint8_t *prefixlen)
+{
+ assert_return(nd, -EINVAL);
+ assert_return(addr, -EINVAL);
+ assert_return(prefixlen, -EINVAL);
+
+ if (!nd->expired_prefix)
+ return -EADDRNOTAVAIL;
+
+ *addr = &nd->expired_prefix->addr;
+ *prefixlen = nd->expired_prefix->len;
+
+ return 0;
+}
+
static int icmp6_ra_prefix_update(sd_icmp6_nd *nd, ssize_t len,
const struct nd_opt_prefix_info *prefix_opt) {
int r;