Split UDPMux and UniversalUDPMux

This commit is contained in:
braginini
2022-09-06 20:44:49 +02:00
parent 2829cce644
commit 0721b87c56
4 changed files with 104 additions and 28 deletions

View File

@@ -89,7 +89,8 @@ type Engine struct {
wgInterface *iface.WGIface
iceMux ice.UniversalUDPMux
iceMux ice.UniversalUDPMux
iceHostMux ice.UDPMux
// networkSerial is the latest CurrentSerial (state ID) of the network sent by the Management service
networkSerial uint64
@@ -249,6 +250,12 @@ func (e *Engine) Start() error {
}
e.iceMux = iceMux
iceHostMux, err := bind.GetICEHostMux()
if err != nil {
return err
}
e.iceHostMux = iceHostMux
log.Infof("NetBird Engine started listening on WireGuard port %d", *port)
e.receiveSignalEvents()
@@ -743,7 +750,7 @@ func (e Engine) createPeerConn(pubKey string, allowedIPs string) (*peer.Conn, er
StunTurn: stunTurn,
InterfaceBlackList: e.config.IFaceBlackList,
Timeout: timeout,
UDPMux: e.iceMux,
UDPMux: e.iceHostMux,
UDPMuxSrflx: e.iceMux,
ProxyConfig: proxyConfig,
LocalWgPort: e.config.WgPort,