Now that IP address sharing is handled with ARP announcements.
This fixes the issue where RFC5227 kernels would fail to compile
if not compiled for ARPING as well.
#include "ipv4ll.h"
#include "logerr.h"
-#if defined(ARP) && (!defined(KERNEL_RFC5227) || defined(ARPING))
+#if defined(ARP)
#define ARP_LEN \
(sizeof(struct arphdr) + (2 * sizeof(uint32_t)) + (2 * HWADDR_LEN))
astate->iface->name, inet_ntoa(astate->addr));
arp_probe1(astate);
}
-#else /* !ARP */
-#define arp_close(ifp) {}
#endif /* ARP */
static void
#define ARP_CSTATE(ifp) \
((const struct iarp_state *)(ifp)->if_data[IF_DATA_ARP])
-#if defined(ARP) && (!defined(KERNEL_RFC5227) || defined(ARPING))
+#ifdef ARP
int arp_open(struct interface *);
ssize_t arp_request(const struct interface *, in_addr_t, in_addr_t);
void arp_probe(struct arp_state *);
void arp_close(struct interface *);
-#endif
-
-#ifdef ARP
void arp_report_conflicted(const struct arp_state *, const struct arp_msg *);
struct arp_state *arp_new(struct interface *, const struct in_addr *);
struct arp_state *arp_find(struct interface *, const struct in_addr *);
void arp_drop(struct interface *);
void arp_handleifa(int, struct ipv4_addr *);
-#else
-#define arp_drop(a) {}
-#endif
-#endif
+#endif /* ARP */
+#endif /* ARP_H */
dhcp_expire1(ifp);
}
-#ifdef ARP
+#if defined(ARP) || defined(IN_IFF_DUPLICATED)
static void
dhcp_decline(struct interface *ifp)
{
astate->failed = astate->addr;
arp_report_conflicted(astate, amsg);
unlink(state->leasefile);
+#ifdef ARP
if (!(ifp->options->options & DHCPCD_STATIC) &&
!state->lease.frominfo)
dhcp_decline(ifp);
+#endif
#ifdef IN_IFF_DUPLICATED
if ((ia = ipv4_iffindaddr(ifp, &astate->addr, NULL)) != NULL)
ipv4_deladdr(ia, 1);
case 0:
LOGDHCP(logwarnx, "IPv4LL disabled from");
ipv4ll_drop(ifp);
+#ifdef ARP
arp_drop(ifp);
+#endif
break;
case 1:
LOGDHCP(logwarnx, "IPv4LL enabled from");
struct dhcpcd_ctx *ctx;
dhcp_close(ifp);
+#ifdef ARP
arp_drop(ifp);
+#endif
if (state) {
state->state = DHS_NONE;
free(state->old);
void
dhcp_abort(struct interface *ifp)
{
-#ifdef ARPING
struct dhcp_state *state;
state = D_STATE(ifp);
+#ifdef ARPING
if (state != NULL)
state->arping_index = -1;
#endif
ipv6_drop(ifp);
ipv4ll_drop(ifp);
dhcp_drop(ifp, stop ? "STOP" : "EXPIRE");
+#ifdef ARP
arp_drop(ifp);
+#endif
}
static void
ifp->carrier = LINK_DOWN;
script_runreason(ifp, "NOCARRIER");
#ifdef NOCARRIER_PRESERVE_IP
+#ifdef ARP
arp_drop(ifp);
+#endif
dhcp_abort(ifp);
ipv6nd_expire(ifp, 0);
#else