From 48733852147663a4fd6acbd3206ce72168eab60c Mon Sep 17 00:00:00 2001 From: Jordan Whited Date: Fri, 15 May 2020 16:30:33 -0700 Subject: [PATCH] fix extra parsing --- cmd/client/main.go | 6 +++--- go.sum | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/client/main.go b/cmd/client/main.go index 7625c60..9a47c38 100644 --- a/cmd/client/main.go +++ b/cmd/client/main.go @@ -96,13 +96,13 @@ func main() { pubKeyBase64) } var endpointIP net.IP - hostA, ok := r.Answer[0].(*dns.A) + hostA, ok := r.Extra[0].(*dns.A) if !ok { - hostAAAA, ok := r.Answer[0].(*dns.AAAA) + hostAAAA, ok := r.Extra[0].(*dns.AAAA) if !ok { log.Printf( "[%s] non-A/AAAA extra in SRV response: %s", - pubKeyBase64, r.Extra[0].Header()) + pubKeyBase64, r.Extra[0].String()) continue } endpointIP = hostAAAA.AAAA diff --git a/go.sum b/go.sum index bceefac..95168ad 100644 --- a/go.sum +++ b/go.sum @@ -244,9 +244,11 @@ github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mdlayher/genetlink v1.0.0 h1:OoHN1OdyEIkScEmRgxLEe2M9U8ClMytqA5niynLtfj0= github.com/mdlayher/genetlink v1.0.0/go.mod h1:0rJ0h4itni50A86M2kHcgS85ttZazNt7a8H2a2cw0Gc= github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= github.com/mdlayher/netlink v1.0.0/go.mod h1:KxeJAFOFLG6AjpyDkQ/iIhxygIUKD+vcwqcnu43w/+M= +github.com/mdlayher/netlink v1.1.0 h1:mpdLgm+brq10nI9zM1BpX1kpDbh3NLl3RSnVq6ZSkfg= github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcKp9uZHgmY= github.com/mholt/certmagic v0.8.3/go.mod h1:91uJzK5K8IWtYQqTi5R2tsxV1pCde+wdGfaRaOZi6aQ= github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=