Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Thomas Renoth <minus@mnus.de>
To: wireguard@lists.zx2c4.com
Cc: Thomas Renoth <minus@mnus.de>
Subject: [PATCH wireguard-go] conn: linux: fix incorrect endpoint address
Date: Tue, 23 Nov 2021 20:03:32 +0100	[thread overview]
Message-ID: <20211123190331.101346-1-minus@mnus.de> (raw)

Signed-off-by: Thomas Renoth <minus@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


             reply	other threads:[~2021-11-23 20:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 19:03 Thomas Renoth [this message]
2021-11-23 21:01 ` Jason A. Donenfeld
2021-11-23 23:23   ` minus
2021-11-25 16:38     ` Jason A. Donenfeld
2021-11-29  0:24       ` wireguard-go fails to send/receive data minus
2021-11-29 17:34         ` Jason A. Donenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211123190331.101346-1-minus@mnus.de \
    --to=minus@mnus.de \
    --cc=wireguard@lists.zx2c4.com \
    --subject='Re: [PATCH wireguard-go] conn: linux: fix incorrect endpoint address' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).