Skip to content

Commit

Permalink
Tweak persistent DHCP client
Browse files Browse the repository at this point in the history
  • Loading branch information
devplayer0 committed Jun 10, 2021
1 parent f5faea0 commit 5ec8126
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/plugin/dhcp_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ func (m *dhcpManager) setupClient(v6 bool) (chan error, error) {
v6Str = "v6"
}

log.
WithFields(m.logFields(v6)).
Info("Starting persistent DHCP client")

client, err := udhcpc.NewDHCPClient(m.ctrLink.Attrs().Name, &udhcpc.DHCPClientOptions{
Hostname: m.hostname,
V6: v6,
Expand Down Expand Up @@ -185,9 +189,11 @@ func (m *dhcpManager) setupClient(v6 bool) (chan error, error) {
}

case <-m.stopChan:
log.WithFields(m.logFields(v6)).Info("Shutting down persistent DHCP client")
log.
WithFields(m.logFields(v6)).
Info("Shutting down persistent DHCP client")

ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

errChan <- client.Finish(ctx)
Expand Down

0 comments on commit 5ec8126

Please sign in to comment.