From 6a67bd7ca8f755029824c141831211909bc44365 Mon Sep 17 00:00:00 2001 From: Olivier Poitrey Date: Sun, 6 Mar 2022 19:34:24 -0800 Subject: [PATCH] Fix missing client field --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index b531efa..70f7dd8 100644 --- a/main.go +++ b/main.go @@ -14,8 +14,8 @@ import ( "sync" "time" - "github.com/nextdns/nextdns/host" "github.com/nextdns/diag/traceroute" + "github.com/nextdns/nextdns/host" ) type Report struct { @@ -49,6 +49,7 @@ type Test struct { Protocol string `json:",omitempty"` Client string `json:",omitempty"` Resolver string `json:",omitempty"` + SrcIP string `json:",omitempty"` DestIP string `json:",omitempty"` Server string `json:",omitempty"` } @@ -234,6 +235,9 @@ func test() Test { if err := j.Decode(&t); err != nil { fmt.Printf(indent("Cannot decode response: %v\n"), err) } + if t.Client == "" { + t.Client, t.SrcIP = t.SrcIP, "" + } fmt.Println(indent(t.String())) return t }