Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Nov 23, 2024
1 parent 9a92c2b commit 05acd16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions netsim/netstack/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,14 @@ func (ns *Stack) dial(protocol IPProtocol, address string) (*Port, error) {
// FindLocalAddrFor returns the first local address that has
// the same IP version as the remote address.
func (ns *Stack) FindLocalAddrFor(raddr netip.Addr) (netip.Addr, error) {
// Normalized to IPv4 if mapped.
// Normalize to IPv4 if mapped.
if raddr.Is4In6() {
raddr = raddr.Unmap()
}

var result netip.Addr
for _, addr := range ns.addrs {
// Normalized to IPv4 if mapped.
// Normalize to IPv4 if mapped.
if addr.Is4In6() {
addr = addr.Unmap()
}
Expand Down

0 comments on commit 05acd16

Please sign in to comment.