Skip to contentSkip to conversation

conn: linux: fix incorrect endpoint address

PATCH In review Thomas Renoth 3 participants 6 messages Nov 23, 2021 – Nov 29, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 conn: linux: fix incorrect endpoint address

---
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(-)
conn/bind_linux.go +1 -1
index 975a6ab..da0670a 100644
@@ -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)
 	}
Signature · 1 line
2.34.0
author
#2 lore raw
Quoted 1 line · Jason A. Donenfeld

Thank you for catching this regression!You're welcome. Unfortunately, I found another one: On an old Debian 8

system, wireguard-go does not receive or send packets anymore, nor does wg show show any sent/received stats. On a current Arch system it works fine. git bisect points to e3134bf (device: defer state machine transitions until configuration is complete) as first bad commit. I haven't further tried reproducing it, hoping that it's something obvious to you.

#3 lore raw

Hey Minus,

I'm not seeing what could be causing this. Could you triple check that it really is busted on Debian 8?

Jason

#4 lore raw

Re: wireguard-go fails to send/receive data

Hi Jason,

Quoted 2 lines

I'm not seeing what could be causing this. Could you triple check that it really is busted on Debian 8?

I was mistaken, it has nothing to do with Debian 8 specifically. I could reproduce it on Arch as well.
When you bring up an interface via wireguard-go and start pinging there's a big chance that nothing at all will work starting with commit e3134bf6. I've attached a script to reproduce the problem. It doesn't always fail, so you may have to run it a few times.