arp_announce(astate);
return astate;
}
-
-struct arp_state *
-arp_announceaddr(struct dhcpcd_ctx *ctx, const struct in_addr *ia)
-{
- struct interface *ifp, *iff = NULL;
- struct ipv4_addr *iap;
-
- TAILQ_FOREACH(ifp, ctx->ifaces, next) {
- if (!ifp->active || !if_is_link_up(ifp))
- continue;
- iap = ipv4_iffindaddr(ifp, ia, NULL);
- if (iap == NULL)
- continue;
-#ifdef IN_IFF_NOTUSEABLE
- if (iap->addr_flags & IN_IFF_NOTUSEABLE)
- continue;
-#endif
- if (iff != NULL && iff->metric < ifp->metric)
- continue;
- iff = ifp;
- }
- if (iff == NULL)
- return NULL;
-
- return arp_ifannounceaddr(iff, ia);
-}
#endif
struct arp_state *
void arp_packet(struct interface *, uint8_t *, size_t, unsigned int);
struct arp_state *arp_new(struct interface *, const struct in_addr *);
void arp_probe(struct arp_state *);
-struct arp_state *arp_announceaddr(struct dhcpcd_ctx *, const struct in_addr *);
struct arp_state *arp_ifannounceaddr(struct interface *, const struct in_addr *);
struct arp_state * arp_find(struct interface *, const struct in_addr *);
void arp_free(struct arp_state *);
}
#endif
- if (ia->flags & IPV4_AF_NEW)
+ if (ia->flags & IPV4_AF_NEW) {
TAILQ_INSERT_TAIL(&state->addrs, ia, next);
+#ifdef ARP
+ arp_ifannounceaddr(ifp, &ia->addr);
+#endif
+ }
+
return ia;
}
rt_build(ifp->ctx, AF_INET);
#ifndef KERNEL_RFC5227
- astate = arp_announceaddr(ifp->ctx, &ia->addr);
+ astate = arp_ifannounceaddr(ifp, &ia->addr);
if (astate != NULL)
astate->announced_cb = ipv4ll_announced_arp;
#endif