sd-ndisc: allow to call sd_ndisc_router_get_lifetime() with NULL for 'ret'

This commit is contained in:
Yu Watanabe
2024-02-19 10:00:33 +09:00
parent 787e71e432
commit 828b5dbf2f

View File

@@ -303,10 +303,11 @@ int sd_ndisc_router_get_flags(sd_ndisc_router *rt, uint64_t *ret) {
int sd_ndisc_router_get_lifetime(sd_ndisc_router *rt, uint64_t *ret) {
assert_return(rt, -EINVAL);
assert_return(ret, -EINVAL);
*ret = rt->lifetime_usec;
return 0;
if (ret)
*ret = rt->lifetime_usec;
return rt->lifetime_usec > 0; /* Indicate if the router is still valid or not. */
}
int sd_ndisc_router_get_preference(sd_ndisc_router *rt, unsigned *ret) {