From d577d9cc24542f28f0070b197964890f2f011ff8 Mon Sep 17 00:00:00 2001 From: "Casares, Francisco M" Date: Tue, 26 Mar 2019 12:49:48 -0700 Subject: [PATCH] DHCP: include Subnet Mask option parameter in DHCPREQUEST DHCP REQUEST from DHCP plugin does not include Subnet Mask option parameter (1). Some DHCP servers need that option to be explicit in order to return it in a DHCPACK message. If not, DHCP plugin returns "DHCP option Subnet Mask not found in DHCPACK" error msg in this type of scenario. --- plugins/ipam/dhcp/lease.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ipam/dhcp/lease.go b/plugins/ipam/dhcp/lease.go index 17a3f912..dc2a9d92 100644 --- a/plugins/ipam/dhcp/lease.go +++ b/plugins/ipam/dhcp/lease.go @@ -130,7 +130,7 @@ func (l *DHCPLease) acquire() error { opts := make(dhcp4.Options) opts[dhcp4.OptionClientIdentifier] = []byte(l.clientID) - opts[dhcp4.OptionParameterRequestList] = []byte{byte(dhcp4.OptionRouter)} + opts[dhcp4.OptionParameterRequestList] = []byte{byte(dhcp4.OptionRouter), byte(dhcp4.OptionSubnetMask)} pkt, err := backoffRetry(func() (*dhcp4.Packet, error) { ok, ack, err := DhcpRequest(c, opts)