Synopsis: dhcpd -y/-Y misfiles a peer's lease when the client's MAC
already has a lease at another address
Category: user
System: OpenBSD 7.9, 8.0, -current
Architecture: amd64
Description:
Follow-up to "dhcpd sync issue" (bugs@, 2026-10-29), which covered the
unicast listener. This is a separate defect (-y <if>).
If the receiver already holds any lease for the client's MAC at a
different address, the peer's lease supersedes that one. The address
the peer actually leased is never recorded. If the existing lease ends
later, the receiver sends it back to the peer instead, and again
nothing is recorded at the right address.
The receiver holds the MAC elsewhere when:
- The client uses one MAC on several subnets (vlan interfaces on one
NIC): every sync lands on one record, so the leases on the other
subnets never sync
- Both servers answered a DHCPDISCOVER and the client took the other's
offer: the loser keeps its untaken offer bound to the MAC;
- The client previously leased another address from it.
Nothing is visible while both servers run. After a failover:
- The survivor considers the client's address free and may offer it to
another host (only the ping check protects it)
- A rebinding client whose MAC the survivor holds at another address
is ignored until its lease expires, then it changes address.
How-To-Repeat:
Two dhcpd servers, A and B, and a client C share one Ethernet segment
(vio0) carrying VLANs 10 and 20. A and B sync with each other over a
separate segment (vio1). Both serve both VLAN subnets. C has one NIC
(one MAC) and takes a lease on each VLAN.
Both /etc/dhcpd.conf:
default-lease-time 120;
max-lease-time 120;
subnet 198.51.100.0 netmask 255.255.255.0 {
range 198.51.100.100 198.51.100.101;
}
subnet 203.0.113.0 netmask 255.255.255.0 {
range 203.0.113.100 203.0.113.101;
}
A: ifconfig vio0 up
A: ifconfig vio1 inet 192.0.2.1/24 up
A: ifconfig vlan10 create vnetid 10 parent vio0
A: ifconfig vlan10 inet 198.51.100.1/24 up
A: ifconfig vlan20 create vnetid 20 parent vio0
A: ifconfig vlan20 inet 203.0.113.1/24 up
A: dhcpd -y vio1 -Y 192.0.2.2 vlan10 vlan20
B: ifconfig vio0 up
B: ifconfig vio1 inet 192.0.2.2/24 up
B: ifconfig vlan10 create vnetid 10 parent vio0
B: ifconfig vlan10 inet 198.51.100.2/24 up
B: ifconfig vlan20 create vnetid 20 parent vio0
B: ifconfig vlan20 inet 203.0.113.2/24 up
B: dhcpd -y vio1 -Y 192.0.2.1 vlan10 vlan20
C: ifconfig vio0 up
C: ifconfig vlan10 create vnetid 10 parent vio0 up
C: ifconfig vlan20 create vnetid 20 parent vio0 up
C: ifconfig vlan10 inet autoconf
C: (a few seconds later) ifconfig vlan20 inet autoconf
C binds 198.51.100.100 on vlan10 and 203.0.113.100 on vlan20, from
either server. Compare /var/db/dhcpd.leases on A and B after the
grants and after each renewal (about every 60 seconds). The server
that did not grant the second lease never writes a record for
203.0.113.100. Each time that lease is granted or renewed, it instead
writes a 198.51.100.100 record with the vlan20 lease's starts and
ends. So its vlan10 record carries the other lease's times, and it has
no record of the vlan20 address C is using.
Background:
I am developing Ansible modules for various OpenBSD capabilities. This
was uncovered during CI tests on a module for dhcpd.