sd-ndisc: don't inform the caller of expired prefixes
The caller should push any lifetime information into the kernel and let the kernel handle prefix expiration.
This commit is contained in:
parent
c93578f54b
commit
77b05fa9a7
|
@ -67,7 +67,6 @@ struct sd_ndisc {
|
|||
int index;
|
||||
struct ether_addr mac_addr;
|
||||
uint32_t mtu;
|
||||
NDiscPrefix *expired_prefix;
|
||||
LIST_HEAD(NDiscPrefix, prefixes);
|
||||
int fd;
|
||||
sd_event_source *recv;
|
||||
|
@ -283,11 +282,6 @@ static int ndisc_prefix_timeout(sd_event_source *s, uint64_t usec,
|
|||
|
||||
LIST_REMOVE(prefixes, nd->prefixes, prefix);
|
||||
|
||||
nd->expired_prefix = prefix;
|
||||
ndisc_notify(nd,
|
||||
SD_NDISC_EVENT_ROUTER_ADVERTISMENT_PREFIX_EXPIRED);
|
||||
nd->expired_prefix = NULL;
|
||||
|
||||
prefix = ndisc_prefix_unref(prefix);
|
||||
|
||||
break;
|
||||
|
@ -390,20 +384,6 @@ int sd_ndisc_get_prefixlen(sd_ndisc *nd, const struct in6_addr *addr,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int sd_ndisc_get_expired_prefix(sd_ndisc *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 ndisc_prefix_update(sd_ndisc *nd, ssize_t len,
|
||||
const struct nd_opt_prefix_info *prefix_opt) {
|
||||
int r;
|
||||
|
|
|
@ -38,7 +38,6 @@ static void ndisc_router_handler(sd_ndisc *nd, int event, void *userdata) {
|
|||
|
||||
switch(event) {
|
||||
case SD_NDISC_EVENT_ROUTER_ADVERTISMENT_NONE:
|
||||
case SD_NDISC_EVENT_ROUTER_ADVERTISMENT_PREFIX_EXPIRED:
|
||||
return;
|
||||
|
||||
case SD_NDISC_EVENT_ROUTER_ADVERTISMENT_OTHER:
|
||||
|
|
|
@ -31,7 +31,6 @@ enum {
|
|||
SD_NDISC_EVENT_ROUTER_ADVERTISMENT_TIMEOUT = 1,
|
||||
SD_NDISC_EVENT_ROUTER_ADVERTISMENT_OTHER = 2,
|
||||
SD_NDISC_EVENT_ROUTER_ADVERTISMENT_MANAGED = 3,
|
||||
SD_NDISC_EVENT_ROUTER_ADVERTISMENT_PREFIX_EXPIRED = 4,
|
||||
};
|
||||
|
||||
typedef struct sd_ndisc sd_ndisc;
|
||||
|
@ -58,8 +57,6 @@ int sd_ndisc_prefix_match(struct in6_addr *prefix, uint8_t prefixlen,
|
|||
int sd_ndisc_get_mtu(sd_ndisc *nd, uint32_t *mtu);
|
||||
int sd_ndisc_get_prefixlen(sd_ndisc *nd, const struct in6_addr *addr,
|
||||
uint8_t *prefixlen);
|
||||
int sd_ndisc_get_expired_prefix(sd_ndisc *nd, struct in6_addr **addr,
|
||||
uint8_t *prefixlen);
|
||||
|
||||
int sd_ndisc_stop(sd_ndisc *nd);
|
||||
int sd_ndisc_router_discovery_start(sd_ndisc *nd);
|
||||
|
|
Loading…
Reference in a new issue