[PATCH] Track and validate disputed addresses

Cherry-picked from
https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/
master/net-misc/dhcpcd/files/patches/dhcpcd-6.8.2-Track-and-validate-
disputed-addresses.patch.

Keep track of whether we have received a NAK response.  If we
accept an ACK shortly after a NAK, although we accept this
address, it must be more carefully evaluated by using the "ARP
for self" method.  If this method succeeds, the system should
proceed as normal (either doing a gateway ARP or sending the
success notification via D-Bus).

Moreover, if the "ARP self" method fails, it will DECLINE the
lease and restart the DHCP process.  When examining any messages
from the DHCP server in this restarted session, ignore the
first OFFER if it is for the previously declined IP address.
In scenarios where there may be more than one conflicting DHCP
server on the network, this allows the possibility to accept
a more viable offer.

BUG: 22956197
Change-Id: I3f2e6cfbaf9c14ce09218e817e2dd35517d78f85

Reviewed-on: https://chromium-review.googlesource.com/208273
diff --git a/arp.c b/arp.c
index 5fb23a3..96cf40c 100644
--- a/arp.c
+++ b/arp.c
@@ -133,6 +133,7 @@
 	int flags;
 
 	state = D_STATE(ifp);
+	state->failed.s_addr = 0;
 	flags = 0;
 	while (!(flags & RAW_EOF)) {
 		bytes = if_readrawpacket(ifp, ETHERTYPE_ARP,