-
Notifications
You must be signed in to change notification settings - Fork 128
dhcpcd Does Not Send an ARP Probe to Detect Duplicate Address by Default #488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Just noticed that sometimes it sends the probe: root@localhost:~# dhcpcd eth0.168
dhcpcd-10.0.5 starting
duid_get: cannot write duid: Read-only file system
DUID 00:03:00:01:ba:cd:d7:65:ae:14
eth0.168: IAID ff:00:00:a8
eth0.168: soliciting an IPv6 router
eth0.168: soliciting a DHCP lease
eth0.168: offered 192.168.31.151 from 192.168.31.1
eth0.168: probing address 192.168.31.151/24
eth0.168: leased 192.168.31.151 for 43200 seconds
dhcp_writefile: /var/db/dhcpcd/eth0.168.lease: Read-only file system
eth0.168: adding route to 192.168.31.0/24
eth0.168: adding default route via 192.168.31.1 Sometimes not: root@localhost:~# dhcpcd eth0.168
dhcpcd-10.0.5 starting
duid_get: cannot write duid: Read-only file system
DUID 00:03:00:01:ba:cd:d7:65:ae:14
eth0.168: IAID ff:00:00:a8
eth0.168: soliciting a DHCP lease
eth0.168: offered 192.168.31.151 from 192.168.31.1
eth0.168: leased 192.168.31.151 for 43200 seconds
dhcp_writefile: /var/db/dhcpcd/eth0.168.lease: Read-only file system
eth0.168: adding route to 192.168.31.0/24
eth0.168: adding default route via 192.168.31.1 |
After studying dhcpcd code, seems if the interface already has an IP address before the DHCP offer, dhcpcd will skip probing. The problem is that, even I use the following commands to remove all IP addresses from the interface: root@localhost:~# ip a flush dev eth0.168
root@localhost:~# ip a show dev eth0.168
3: eth0.168@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether ba:cd:d7:65:ae:14 brd ff:ff:ff:ff:ff:ff dhcpcd still gets an IP address from eth0.168. Code: // src/dhcp.c
static int
dhcp_arp_address(struct interface *ifp)
{
// ia is not NULL here. I printed ia->addr.s_addr, it is still the previous IP address before it was removed
if (ia == NULL) {
state->state = DHS_PROBE;
get_lease(ifp, &l, state->offer, state->offer_len);
logerr("%s: probing address %s/%d",
ifp->name, inet_ntoa(l.addr), inet_ntocidr(l.mask));
/* We need to handle DAD. */
arp_probe(astate);
return 0;
}
} As a workaround, I have to use these commands: ip a flush dev eth0.168
ip a show dev eth0.168
ip link set dev eth0.168 down
ip link set dev eth0.168 up
killall -9 dhcpcd
dhcpcd eth0.168 |
You are correct, dhcpcd will only perform the initial ARP probe if the address does not exist on the interface. I suppose the question becomes what value do you think you gain from ARP probing an address which exists on your interface already? |
I think skipping ARP probing is reasonable when the interface already has an IP address. But since I have removed all IP addresses with Line 2641 in e8b2c8f
BTW, if DHCP server offers a different IP adress as the existing one, I think dhcpcd should perform the probe too. |
I use dhcpcd with the default /etc/dhcpcd.conf, and enabled "hostname" option, no other changes.
In another terminal, I run
tcpdump -v -i eth0.168
and found that no arp probe was sent.Is there an option to enable DAD?
The text was updated successfully, but these errors were encountered: