mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
typo fix
This commit is contained in:
parent
a7afacb0df
commit
173e417c68
1 changed files with 8 additions and 9 deletions
|
@ -6,11 +6,11 @@ package core
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
|
||||||
"net/url"
|
|
||||||
"net/netip"
|
|
||||||
"strings"
|
|
||||||
"github.com/getlantern/multipath"
|
"github.com/getlantern/multipath"
|
||||||
|
"net"
|
||||||
|
"net/netip"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/Arceliar/phony"
|
"github.com/Arceliar/phony"
|
||||||
)
|
)
|
||||||
|
@ -46,7 +46,7 @@ func (l *linkMPATH) dial(url *url.URL, options linkOptions, sintf string) error
|
||||||
dial := &linkDial{
|
dial := &linkDial{
|
||||||
url: url,
|
url: url,
|
||||||
sintf: sintf,
|
sintf: sintf,
|
||||||
|
}
|
||||||
return l.handler(dial, url.String(), info, conn, options, false, false)
|
return l.handler(dial, url.String(), info, conn, options, false, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ func (l *linkMPATH) listen(url *url.URL, sintf string) (*Listener, error) {
|
||||||
func (l *linkMPATH) handler(dial *linkDial, name string, info linkInfo, conn net.Conn, options linkOptions, incoming bool, force bool) error {
|
func (l *linkMPATH) handler(dial *linkDial, name string, info linkInfo, conn net.Conn, options linkOptions, incoming bool, force bool) error {
|
||||||
return l.links.create(
|
return l.links.create(
|
||||||
conn, // connection
|
conn, // connection
|
||||||
dial, // connection URL
|
dial, // connection URL
|
||||||
name, // connection name
|
name, // connection name
|
||||||
info, // connection info
|
info, // connection info
|
||||||
incoming, // not incoming
|
incoming, // not incoming
|
||||||
|
@ -121,7 +121,6 @@ func (l *linkMPATH) getAddr() *net.TCPAddr {
|
||||||
return addr
|
return addr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (l *linkMPATH) connFor(url *url.URL, sinterfaces string) (net.Conn, error) {
|
func (l *linkMPATH) connFor(url *url.URL, sinterfaces string) (net.Conn, error) {
|
||||||
//Peer url has following format: mpath://host-1:port-1/host-2:port-2.../host-n:port-n
|
//Peer url has following format: mpath://host-1:port-1/host-2:port-2.../host-n:port-n
|
||||||
hosts := strings.Split(url.String(), "/")[2:]
|
hosts := strings.Split(url.String(), "/")[2:]
|
||||||
|
@ -158,7 +157,7 @@ func (l *linkMPATH) connFor(url *url.URL, sinterfaces string) (net.Conn, error)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
src := net.ParseIP(addr.WithZone("").String())
|
src := net.ParseIP(addr.WithZone("").String())
|
||||||
|
|
||||||
dstIp := dst.(*net.TCPAddr).IP
|
dstIp := dst.(*net.TCPAddr).IP
|
||||||
|
|
||||||
if !src.IsGlobalUnicast() && !src.IsLinkLocalUnicast() {
|
if !src.IsGlobalUnicast() && !src.IsLinkLocalUnicast() {
|
||||||
|
@ -178,7 +177,7 @@ func (l *linkMPATH) connFor(url *url.URL, sinterfaces string) (net.Conn, error)
|
||||||
trackers = append(trackers, multipath.NullTracker{})
|
trackers = append(trackers, multipath.NullTracker{})
|
||||||
l.core.log.Printf("added outbound dialer for %s->%s", src.String(), dst.String())
|
l.core.log.Printf("added outbound dialer for %s->%s", src.String(), dst.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue