mirror of
https://git.zx2c4.com/wireguard-go
synced 2024-11-15 01:05:15 +01:00
conn: fix WinRingEndpoint.DstToString() for AF_INET endpoints
Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
parent
052af4a807
commit
ac2fe4ce92
@ -164,7 +164,7 @@ func (e *WinRingEndpoint) DstToBytes() []byte {
|
|||||||
func (e *WinRingEndpoint) DstToString() string {
|
func (e *WinRingEndpoint) DstToString() string {
|
||||||
switch e.family {
|
switch e.family {
|
||||||
case windows.AF_INET:
|
case windows.AF_INET:
|
||||||
netip.AddrPortFrom(netip.AddrFrom4(*(*[4]byte)(e.data[2:6])), binary.BigEndian.Uint16(e.data[0:2])).String()
|
return netip.AddrPortFrom(netip.AddrFrom4(*(*[4]byte)(e.data[2:6])), binary.BigEndian.Uint16(e.data[0:2])).String()
|
||||||
case windows.AF_INET6:
|
case windows.AF_INET6:
|
||||||
var zone string
|
var zone string
|
||||||
if scope := *(*uint32)(unsafe.Pointer(&e.data[22])); scope > 0 {
|
if scope := *(*uint32)(unsafe.Pointer(&e.data[22])); scope > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user