[PATCH wireguard-go] conn: linux: fix incorrect endpoint address

Thomas Renoth minus at mnus.de
Tue Nov 23 19:03:32 UTC 2021


Signed-off-by: Thomas Renoth <minus at mnus.de>
---
`wg show` just shows 0.0.0.0:<port> for peer endpoints currently.

 conn/bind_linux.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/conn/bind_linux.go b/conn/bind_linux.go
index 975a6ab..da0670a 100644
--- a/conn/bind_linux.go
+++ b/conn/bind_linux.go
@@ -275,7 +275,7 @@ func (end *LinuxSocketEndpoint) SrcIP() netip.Addr {
 
 func (end *LinuxSocketEndpoint) DstIP() netip.Addr {
 	if !end.isV6 {
-		return netip.AddrFrom4(end.src4().Src)
+		return netip.AddrFrom4(end.dst4().Addr)
 	} else {
 		return netip.AddrFrom16(end.dst6().Addr)
 	}
-- 
2.34.0



More information about the WireGuard mailing list