Thanks for having a look at it!
I've tested it again with the same result, please see the attached logs
from tcpdump (where i've edited the mac addresses: NetBSD:
aa:aa:aa:aa:aa:aa, Linux: bb:bb:bb:bb:bb:bb)
The testing setup was in both attempts:
* NetBSD (8.1_STABLE, built on 6th Jul 2019) wm0 has static address
172.31.255.254/30
* the machines are connected directly with a cable (no switch etc.)
* the Linux machine is offline (and thus the flags field of NetBSD wm0
has value: 0x4<DETACHED>), with attached dhcpcd config amendment
* tcpdump is launched on NetBSD host
* the Linux machine is turned on
Looking at the patch you've attached I guess the culprit is probably
that due to the direct connect, the wm0 address is tentative at the
moment of the arping (the link goes up and down several times before the
arping) and thus not being defended?