[PATCH] Optionally ARP for gateway IP address

Cherry-picked from
https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/
master/net-misc/dhcpcd/files/patches/dhcpcd-6.8.2-Optionally-ARP-for-gateway-
IP-address.patch.

If the "arpgw" option is enabled in the config, we ARP for
the gateway provided in the DHCP response as part of the
process of testing our lease.  If this fails (ARP times
out) we DECLINE our lease in the hope that a new lease will
work better.  This can allow us to work around issues with
infrastructures where IP address / MAC pairs are placed on
a "dummy" VLAN under certain conditions.  Requesting a
different IP can sometimes help resolve this.

The code is setup so that for each dhcpcd instance, the
"arpgw" function is allowed to only fail once.  This is
to protect ourselves from mistakenly diagnosing a bad
system, or from looping endlessly if the system is truly
hosed.

BUG: 22956197
Change-Id: I0f49882e85b2cac08dd3bd0046cacf564f8b4749

Reviewed-on: http://gerrit.chromium.org/gerrit/3080
Reviewed-on: http://gerrit.chromium.org/gerrit/3531
5 files changed