MCPcopy
hub / github.com/AdguardTeam/dnsproxy / firstIP

Function firstIP

proxy/proxy_internal_test.go:178–189  ·  view source on GitHub ↗

firstIP returns the first IP address from the DNS response.

(resp *dns.Msg)

Source from the content-addressed store, hash-verified

176
177// firstIP returns the first IP address from the DNS response.
178func firstIP(resp *dns.Msg) (ip net.IP) {
179 for _, ans := range resp.Answer {
180 a, ok := ans.(*dns.A)
181 if !ok {
182 continue
183 }
184
185 return a.A
186 }
187
188 return nil
189}
190
191type testUpstream struct {
192 ans []dns.RR

Callers 3

TestECSProxyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…