mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-10 22:03:58 +01:00
Fix mobile builds (#1035)
This commit is contained in:
parent
1d2f95e718
commit
af2fc48378
@ -18,7 +18,7 @@ type tun struct {
|
|||||||
io.ReadWriteCloser
|
io.ReadWriteCloser
|
||||||
fd int
|
fd int
|
||||||
cidr *net.IPNet
|
cidr *net.IPNet
|
||||||
routeTree *cidr.Tree4
|
routeTree *cidr.Tree4[iputil.VpnIp]
|
||||||
l *logrus.Logger
|
l *logrus.Logger
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,12 +46,8 @@ func newTun(_ *logrus.Logger, _ string, _ *net.IPNet, _ int, _ []Route, _ int, _
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *tun) RouteFor(ip iputil.VpnIp) iputil.VpnIp {
|
func (t *tun) RouteFor(ip iputil.VpnIp) iputil.VpnIp {
|
||||||
r := t.routeTree.MostSpecificContains(ip)
|
_, r := t.routeTree.MostSpecificContains(ip)
|
||||||
if r != nil {
|
return r
|
||||||
return r.(iputil.VpnIp)
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t tun) Activate() error {
|
func (t tun) Activate() error {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import (
|
|||||||
type tun struct {
|
type tun struct {
|
||||||
io.ReadWriteCloser
|
io.ReadWriteCloser
|
||||||
cidr *net.IPNet
|
cidr *net.IPNet
|
||||||
routeTree *cidr.Tree4
|
routeTree *cidr.Tree4[iputil.VpnIp]
|
||||||
}
|
}
|
||||||
|
|
||||||
func newTun(_ *logrus.Logger, _ string, _ *net.IPNet, _ int, _ []Route, _ int, _ bool, _ bool) (*tun, error) {
|
func newTun(_ *logrus.Logger, _ string, _ *net.IPNet, _ int, _ []Route, _ int, _ bool, _ bool) (*tun, error) {
|
||||||
@ -46,12 +46,8 @@ func (t *tun) Activate() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *tun) RouteFor(ip iputil.VpnIp) iputil.VpnIp {
|
func (t *tun) RouteFor(ip iputil.VpnIp) iputil.VpnIp {
|
||||||
r := t.routeTree.MostSpecificContains(ip)
|
_, r := t.routeTree.MostSpecificContains(ip)
|
||||||
if r != nil {
|
return r
|
||||||
return r.(iputil.VpnIp)
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The following is hoisted up from water, we do this so we can inject our own fd on iOS
|
// The following is hoisted up from water, we do this so we can inject our own fd on iOS
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user