From fd4c3350ae9eb633fb42603fea322173a5f2eac2 Mon Sep 17 00:00:00 2001 From: Michael Wyrick Date: Mon, 27 Dec 2021 13:27:51 -0500 Subject: [PATCH 1/2] Fixed DHCP problem that broke when fast retry was added. Signed-off-by: Michael Wyrick --- 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 943e6e2c..e36b768e 100644 --- a/plugins/ipam/dhcp/lease.go +++ b/plugins/ipam/dhcp/lease.go @@ -455,7 +455,7 @@ func backoffRetry(resendMax time.Duration, f func() (*dhcp4.Packet, error)) (*dh // only adjust delay time if we are in normal backoff stage if baseDelay < resendMax && fastRetryLimit == 0 { baseDelay *= 2 - } else { + } else if fastRetryLimit == 0 { // only break if we are at normal delay break } } From 1324428a9a3a8fb1beaafb1382841fb89416ad06 Mon Sep 17 00:00:00 2001 From: Michael Wyrick Date: Tue, 28 Dec 2021 10:42:37 -0500 Subject: [PATCH 2/2] Ran go fmt so tests would pass Signed-off-by: Michael Wyrick --- 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 e36b768e..214e26ff 100644 --- a/plugins/ipam/dhcp/lease.go +++ b/plugins/ipam/dhcp/lease.go @@ -455,7 +455,7 @@ func backoffRetry(resendMax time.Duration, f func() (*dhcp4.Packet, error)) (*dh // only adjust delay time if we are in normal backoff stage if baseDelay < resendMax && fastRetryLimit == 0 { baseDelay *= 2 - } else if fastRetryLimit == 0 { // only break if we are at normal delay + } else if fastRetryLimit == 0 { // only break if we are at normal delay break } }