Skip to content

Commit 5228ee5

Browse files
committed
minor fix for prior
1 parent acbac12 commit 5228ee5

File tree

4 files changed

+7
-29
lines changed

4 files changed

+7
-29
lines changed

src/arp.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -530,32 +530,6 @@ arp_ifannounceaddr(struct interface *ifp, const struct in_addr *ia)
530530
arp_announce(astate);
531531
return astate;
532532
}
533-
534-
struct arp_state *
535-
arp_announceaddr(struct dhcpcd_ctx *ctx, const struct in_addr *ia)
536-
{
537-
struct interface *ifp, *iff = NULL;
538-
struct ipv4_addr *iap;
539-
540-
TAILQ_FOREACH(ifp, ctx->ifaces, next) {
541-
if (!ifp->active || !if_is_link_up(ifp))
542-
continue;
543-
iap = ipv4_iffindaddr(ifp, ia, NULL);
544-
if (iap == NULL)
545-
continue;
546-
#ifdef IN_IFF_NOTUSEABLE
547-
if (iap->addr_flags & IN_IFF_NOTUSEABLE)
548-
continue;
549-
#endif
550-
if (iff != NULL && iff->metric < ifp->metric)
551-
continue;
552-
iff = ifp;
553-
}
554-
if (iff == NULL)
555-
return NULL;
556-
557-
return arp_ifannounceaddr(iff, ia);
558-
}
559533
#endif
560534

561535
struct arp_state *

src/arp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ struct iarp_state {
9696
void arp_packet(struct interface *, uint8_t *, size_t, unsigned int);
9797
struct arp_state *arp_new(struct interface *, const struct in_addr *);
9898
void arp_probe(struct arp_state *);
99-
struct arp_state *arp_announceaddr(struct dhcpcd_ctx *, const struct in_addr *);
10099
struct arp_state *arp_ifannounceaddr(struct interface *, const struct in_addr *);
101100
struct arp_state * arp_find(struct interface *, const struct in_addr *);
102101
void arp_free(struct arp_state *);

src/ipv4.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,13 @@ ipv4_addaddr(struct interface *ifp, const struct in_addr *addr,
715715
}
716716
#endif
717717

718-
if (ia->flags & IPV4_AF_NEW)
718+
if (ia->flags & IPV4_AF_NEW) {
719719
TAILQ_INSERT_TAIL(&state->addrs, ia, next);
720+
#ifdef ARP
721+
arp_ifannounceaddr(ifp, &ia->addr);
722+
#endif
723+
}
724+
720725
return ia;
721726
}
722727

src/ipv4ll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ ipv4ll_not_found(struct interface *ifp)
268268
rt_build(ifp->ctx, AF_INET);
269269

270270
#ifndef KERNEL_RFC5227
271-
astate = arp_announceaddr(ifp->ctx, &ia->addr);
271+
astate = arp_ifannounceaddr(ifp, &ia->addr);
272272
if (astate != NULL)
273273
astate->announced_cb = ipv4ll_announced_arp;
274274
#endif

0 commit comments

Comments
 (0)