mirror of
https://github.com/slackhq/nebula.git
synced 2026-04-03 14:35:18 +02:00
split the client-snat-addr and the router-snat-addr to decrease confusion hopefully
This commit is contained in:
@@ -58,16 +58,16 @@ type addrLifetime struct {
|
||||
}
|
||||
|
||||
type tun struct {
|
||||
Device string
|
||||
vpnNetworks []netip.Prefix
|
||||
unsafeNetworks []netip.Prefix
|
||||
snatAddr netip.Prefix
|
||||
MTU int
|
||||
Routes atomic.Pointer[[]Route]
|
||||
routeTree atomic.Pointer[bart.Table[routing.Gateways]]
|
||||
l *logrus.Logger
|
||||
f *os.File
|
||||
fd int
|
||||
Device string
|
||||
vpnNetworks []netip.Prefix
|
||||
unsafeNetworks []netip.Prefix
|
||||
unsafeIPv4Origin netip.Prefix
|
||||
MTU int
|
||||
Routes atomic.Pointer[[]Route]
|
||||
routeTree atomic.Pointer[bart.Table[routing.Gateways]]
|
||||
l *logrus.Logger
|
||||
f *os.File
|
||||
fd int
|
||||
}
|
||||
|
||||
var deviceNameRE = regexp.MustCompile(`^tun[0-9]+$`)
|
||||
@@ -353,7 +353,7 @@ func (t *tun) reload(c *config.C, initial bool) error {
|
||||
}
|
||||
|
||||
if initial {
|
||||
t.snatAddr = prepareSnatAddr(t, t.l, c, routes)
|
||||
t.unsafeIPv4Origin = prepareUnsafeOriginAddr(t, t.l, c, routes)
|
||||
}
|
||||
|
||||
routeTree, err := makeRouteTree(t.l, routes, false)
|
||||
@@ -396,8 +396,12 @@ func (t *tun) UnsafeNetworks() []netip.Prefix {
|
||||
return t.unsafeNetworks
|
||||
}
|
||||
|
||||
func (t *tun) UnsafeIPv4OriginAddress() netip.Prefix {
|
||||
return t.unsafeIPv4Origin
|
||||
}
|
||||
|
||||
func (t *tun) SNATAddress() netip.Prefix {
|
||||
return t.snatAddr
|
||||
return netip.Prefix{}
|
||||
}
|
||||
|
||||
func (t *tun) Name() string {
|
||||
|
||||
Reference in New Issue
Block a user