mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 08:16:39 +00:00
Resolve tracer 'self' to v6 overlay address when peer is IPv6
The packet tracer resolved 'self' to the v4 overlay address unconditionally, causing "mixed address families" errors when tracing v6 traffic. Pick the self address matching the peer's address family. Add Engine.GetWgV6Addr() and rework parseAddress into resolveTraceAddresses which parses the non-self address first to determine the family, then resolves self accordingly.
This commit is contained in:
@@ -2159,6 +2159,14 @@ func (e *Engine) GetWgAddr() netip.Addr {
|
||||
return e.wgInterface.Address().IP
|
||||
}
|
||||
|
||||
// GetWgV6Addr returns the IPv6 overlay address of the WireGuard interface.
|
||||
func (e *Engine) GetWgV6Addr() netip.Addr {
|
||||
if e.wgInterface == nil {
|
||||
return netip.Addr{}
|
||||
}
|
||||
return e.wgInterface.Address().IPv6
|
||||
}
|
||||
|
||||
func (e *Engine) RenewTun(fd int) error {
|
||||
e.syncMsgMux.Lock()
|
||||
wgInterface := e.wgInterface
|
||||
|
||||
Reference in New Issue
Block a user