wgengine/magicsock: remove endpoint.wgEndpoint (#5911)
This field seems seldom used and the documentation is wrong. It is simpler to just derive its original value dynamically when endpoint.DstToString is called. This method is potentially used by wireguard-go, but not in any code path is performance sensitive. All calls to it use it in conjunction with fmt.Printf, which is going to be slow anyways since it uses Go reflection. Signed-off-by: Joe Tsai <joetsai@digital-static.net>
This commit is contained in:
@@ -1731,9 +1731,6 @@ func (m *peerMap) validate() error {
|
||||
if got := pi.ep.publicKey; got != pub {
|
||||
return fmt.Errorf("byNodeKey[%v].publicKey = %v", pub, got)
|
||||
}
|
||||
if got, want := pi.ep.wgEndpoint, pub.UntypedHexString(); got != want {
|
||||
return fmt.Errorf("byNodeKey[%v].wgEndpoint = %q, want %q", pub, got, want)
|
||||
}
|
||||
if _, ok := seenEps[pi.ep]; ok {
|
||||
return fmt.Errorf("duplicate endpoint present: %v", pi.ep.publicKey)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user