drop and free or just free IPv6 temporary addresses.
dhcp6_drop(ifp, NULL);
ipv6nd_drop(ifp);
+ ipv6_drop(ifp);
dhcp_drop(ifp, "STOP");
arp_close(ifp);
if (ifp->options->options & DHCPCD_DEPARTED)
ifp->carrier = LINK_DOWN;
script_runreason(ifp, "NOCARRIER");
dhcp6_drop(ifp, "EXPIRE6");
- ipv6_drop(ifp);
ipv6nd_drop(ifp);
+ ipv6_drop(ifp);
dhcp_drop(ifp, "EXPIRE");
arp_close(ifp);
}
return 0;
}
-void
-ipv6_drop(struct interface *ifp)
-{
- struct ipv6_state *state;
- struct ll_callback *cb;
-
- state = IPV6_STATE(ifp);
- if (state) {
- while ((cb = TAILQ_FIRST(&state->ll_callbacks))) {
- TAILQ_REMOVE(&state->ll_callbacks, cb, next);
- free(cb);
- }
- ipv6_freedrop_addrs(&state->addrs, 2, NULL);
- }
-}
-
static struct ipv6_addr *
ipv6_newlinklocal(struct interface *ifp)
{
}
void
-ipv6_free(struct interface *ifp)
+ipv6_freedrop(struct interface *ifp, int drop)
{
struct ipv6_state *state;
- struct ipv6_addr *ap;
+ struct ll_callback *cb;
if (ifp) {
- ipv6_drop(ifp);
state = IPV6_STATE(ifp);
if (state) {
- while ((ap = TAILQ_FIRST(&state->addrs))) {
- TAILQ_REMOVE(&state->addrs, ap, next);
- free(ap);
+ while ((cb = TAILQ_FIRST(&state->ll_callbacks))) {
+ TAILQ_REMOVE(&state->ll_callbacks, cb, next);
+ free(cb);
}
+ ipv6_freedrop_addrs(&state->addrs, drop ? 2 : 0, NULL);
free(state);
ifp->if_data[IF_DATA_IPV6] = NULL;
eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp);
const struct in6_addr *, short);
#define ipv6_linklocal(ifp) (ipv6_iffindaddr((ifp), NULL))
int ipv6_addlinklocalcallback(struct interface *, void (*)(void *), void *);
-void ipv6_drop(struct interface *);
+void ipv6_freedrop(struct interface *, int);
+#define ipv6_free(ifp) ipv6_freedrop(ifp, 0)
+#define ipv6_drop(ifp) ipv6_freedrop(ifp, 2)
#ifdef IPV6_MANAGETEMPADDR
void ipv6_gentempifid(struct interface *);
#endif
int ipv6_start(struct interface *);
-void ipv6_free(struct interface *);
void ipv6_ctxfree(struct dhcpcd_ctx *);
int ipv6_routedeleted(struct dhcpcd_ctx *, const struct rt6 *);
int ipv6_removesubnet(struct interface *, struct ipv6_addr *);
#define ipv6_start(a) (-1)
#define ipv6_free_ll_callbacks(a) {}
#define ipv6_free(a) {}
+#define ipv6_drop(a) {}
#define ipv6_ctxfree(a) {}
#endif