Skip to content

Commit

Permalink
Use the same options for acquiring, renewing lease
Browse files Browse the repository at this point in the history
Currently, hostname is set in the original DHCPREQUEST but not the
renewal. With some DHCP server implementations (such as FreeBSD dhcpd),
this leads to the hostname being cleared in the lease table.

This behavior is inconsistent with other DHCP clients such as dhclient
which set the hostname on the renewal request as well. To fix, use the
same options for acquire and renew.

This is compatible with RFC 2131 (see table 5).

Signed-off-by: Akhil Velagapudi <4@4khil.com>
  • Loading branch information
akhilles committed Jun 23, 2022
1 parent 9c59728 commit c5c531b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/ipam/dhcp/lease.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ func (l *DHCPLease) renew() error {
}
defer c.Close()

opts := l.getOptionsWithClientId()
opts := l.getAllOptions()
pkt, err := backoffRetry(l.resendMax, func() (*dhcp4.Packet, error) {
ok, ack, err := DhcpRenew(c, *l.ack, opts)
switch {
Expand Down

0 comments on commit c5c531b

Please sign in to comment.