Skip to content

Commit 5ec8126

Browse files
committed
Tweak persistent DHCP client
1 parent f5faea0 commit 5ec8126

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/plugin/dhcp_manager.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ func (m *dhcpManager) setupClient(v6 bool) (chan error, error) {
124124
v6Str = "v6"
125125
}
126126

127+
log.
128+
WithFields(m.logFields(v6)).
129+
Info("Starting persistent DHCP client")
130+
127131
client, err := udhcpc.NewDHCPClient(m.ctrLink.Attrs().Name, &udhcpc.DHCPClientOptions{
128132
Hostname: m.hostname,
129133
V6: v6,
@@ -185,9 +189,11 @@ func (m *dhcpManager) setupClient(v6 bool) (chan error, error) {
185189
}
186190

187191
case <-m.stopChan:
188-
log.WithFields(m.logFields(v6)).Info("Shutting down persistent DHCP client")
192+
log.
193+
WithFields(m.logFields(v6)).
194+
Info("Shutting down persistent DHCP client")
189195

190-
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
196+
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
191197
defer cancel()
192198

193199
errChan <- client.Finish(ctx)

0 commit comments

Comments
 (0)