mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-22 08:24:25 +01:00
Remove WriteRaw, cidrTree -> routeTree to better describe its purpose, remove redundancy from field names (#582)
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
package overlay
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"runtime"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/slackhq/nebula/cidr"
|
||||
"github.com/slackhq/nebula/config"
|
||||
"github.com/slackhq/nebula/util"
|
||||
)
|
||||
@@ -52,17 +49,3 @@ func NewDeviceFromConfig(c *config.C, l *logrus.Logger, tunCidr *net.IPNet, fd *
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
func makeCidrTree(routes []Route, allowMTU bool) (*cidr.Tree4, error) {
|
||||
cidrTree := cidr.NewTree4()
|
||||
for _, r := range routes {
|
||||
if !allowMTU && r.MTU > 0 {
|
||||
return nil, fmt.Errorf("route MTU is not supported in %s", runtime.GOOS)
|
||||
}
|
||||
|
||||
if r.Via != nil {
|
||||
cidrTree.AddCIDR(r.Cidr, r.Via)
|
||||
}
|
||||
}
|
||||
return cidrTree, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user