arp_report_conflicted(const struct arp_state *astate, const struct arp_msg *amsg)
{
- if (amsg) {
+ if (amsg != NULL) {
char buf[HWADDR_LEN * 3];
logger(astate->iface->ctx, LOG_ERR,
eloop_timeout_delete(ifp->ctx->eloop, NULL, astate);
state = ARP_STATE(ifp);
TAILQ_REMOVE(&state->arp_states, astate, next);
+ if (astate->free_cb)
+ astate->free_cb(astate);
free(astate);
/* If there are no more ARP states, close the socket. */
void (*probed_cb)(struct arp_state *);
void (*announced_cb)(struct arp_state *);
void (*conflicted_cb)(struct arp_state *, const struct arp_msg *);
+ void (*free_cb)(struct arp_state *);
struct in_addr addr;
int probes;
ipv4ll_probe, astate);
}
+static void
+ipv4ll_arpfree(struct arp_state *astate)
+{
+ struct ipv4ll_state *state;
+
+ state = IPV4LL_STATE(astate->iface);
+ if (state->arp == astate)
+ state->arp = NULL;
+}
+
void
ipv4ll_start(void *arg)
{
astate->probed_cb = ipv4ll_probed;
astate->announced_cb = ipv4ll_announced;
astate->conflicted_cb = ipv4ll_conflicted;
+ astate->free_cb = ipv4ll_arpfree;
/* Find an existing IPv4LL address and ensure we can work with it. */
ia = ipv4_iffindlladdr(ifp);