sd_ipv4acd *sd_ipv4acd_unref(sd_ipv4acd *acd) { if (!acd) return NULL; assert_se(acd->n_ref >= 1); acd->n_ref--; if (acd->n_ref > 0) return NULL; ipv4acd_reset(acd); sd_ipv4acd_detach_event(acd); return mfree(acd); }
sd_ipv4acd *sd_ipv4acd_unref(sd_ipv4acd *ll) { if (!ll || REFCNT_DEC(ll->n_ref) > 0) return NULL; ll->receive_message = sd_event_source_unref(ll->receive_message); ll->fd = safe_close(ll->fd); ll->timer = sd_event_source_unref(ll->timer); sd_ipv4acd_detach_event(ll); free(ll); return NULL; }
int sd_ipv4ll_detach_event(sd_ipv4ll *ll) { assert_return(ll, -EINVAL); return sd_ipv4acd_detach_event(ll->acd); }