Skip to content

Commit

Permalink
Add flat onmetal plugin debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
damyan committed Jun 15, 2023
1 parent a1a3e50 commit 24ca4b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/onmetal/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package onmetal

import (
"net"
"strings"
"time"

"github.com/coredhcp/coredhcp/handler"
Expand All @@ -27,7 +28,7 @@ func setup6(args ...string) (handler.Handler6, error) {
}

func handler6(req, resp dhcpv6.DHCPv6) (dhcpv6.DHCPv6, bool) {
log.Printf("Received DHCPv6 request: %s", req.Summary())
log.Printf("Received DHCPv6 request: %s", strings.Replace(req.Summary(), "\n", " ", -1))

if !req.IsRelay() {
log.Printf("Received non-relay DHCPv6 request. Dropping.")
Expand Down Expand Up @@ -62,7 +63,7 @@ func handler6(req, resp dhcpv6.DHCPv6) (dhcpv6.DHCPv6, bool) {
}},
})

log.Printf("Sent DHCPv6 response:\n%s", resp.Summary())
log.Printf("Sent DHCPv6 response: %s", strings.Replace(resp.Summary(), "\n", " ", -1))

return resp, false
}

0 comments on commit 24ca4b1

Please sign in to comment.