Send the expired IP in the old_ prefix.
len++;
if (D_STATE_RUNNING(ifp))
len++;
+ if (IPV4LL_STATE_RUNNING(ifp))
+ len++;
if (RS_STATE_RUNNING(ifp))
len++;
if (D6_STATE_RUNNING(ifp))
ifp->name, DEFEND_INTERVAL,
inet_ntoa(state->addr));
ipv4_deladdr(ifp, &state->addr, &inaddr_llmask, 1);
- state->addr.s_addr = INADDR_ANY;
+ state->down = 1;
script_runreason(ifp, "IPV4LL");
+ state->addr.s_addr = INADDR_ANY;
} else {
logger(ifp->ctx, LOG_DEBUG,
"%s: defended IPv4LL address %s",
unsigned int conflicts;
struct timespec defend;
char randomstate[128];
+ uint8_t down;
};
#define IPV4LL_STATE(ifp) \
#define IPV4LL_CSTATE(ifp) \
((const struct ipv4ll_state *)(ifp)->if_data[IF_DATA_IPV4LL])
#define IPV4LL_STATE_RUNNING(ifp) \
- (IPV4LL_CSTATE((ifp)) && \
+ (IPV4LL_CSTATE((ifp)) && !IPV4LL_CSTATE((ifp))->down && \
IN_LINKLOCAL(ntohl(IPV4LL_CSTATE((ifp))->addr.s_addr)))
struct rt* ipv4ll_subnet_route(const struct interface *);
#ifdef INET
int dhcp, ipv4ll;
const struct dhcp_state *state;
+ const struct ipv4ll_state *istate;
#endif
#ifdef INET6
const struct dhcp6_state *d6_state;
#ifdef INET
dhcp = ipv4ll = 0;
state = D_STATE(ifp);
+ istate = IPV4LL_CSTATE(ifp);
#endif
#ifdef INET6
dhcp6 = ra = 0;
if (nenv == NULL)
goto eexit;
env = nenv;
- if ((n = ipv4ll_env(env + elen, "new", ifp)) == -1)
+ if ((n = ipv4ll_env(env + elen,
+ istate->down ? "old" : "new", ifp)) == -1)
goto eexit;
elen += (size_t)n;
}
if (send_interface1(fd, ifp, d->reason) == -1)
retval = -1;
}
+ if (IPV4LL_STATE_RUNNING(ifp)) {
+ if (send_interface1(fd, ifp, "IPV4LL") == -1)
+ retval = -1;
+ }
#endif
#ifdef INET6