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

Function cloneIPNet

proxy/proxycache.go:68–77  ·  view source on GitHub ↗

cloneIPNet returns a deep clone of n.

(n *net.IPNet)

Source from the content-addressed store, hash-verified

66
67// cloneIPNet returns a deep clone of n.
68func cloneIPNet(n *net.IPNet) (clone *net.IPNet) {
69 if n == nil {
70 return nil
71 }
72
73 return &net.IPNet{
74 IP: slices.Clone(n.IP),
75 Mask: slices.Clone(n.Mask),
76 }
77}
78
79// cacheResp stores the response from d in general or subnet cache. In case the
80// cache is present in d, it's used first.

Callers 1

replyFromCacheMethod · 0.85

Calls 1

CloneMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…