wgengine/router/router_linux.go: fixed " route del failed" error (#756)

* wgengine/router/router_linux.go: Switched `cidrDiff("addr")` and `cidrDiff("route")` order

Signed-off-by: Christina Wen <christina@tailscale.com>

Co-authored-by: Christina Wen <christina@tailscale.com>
reviewable/pr752/r2
Christina Wen 4 years ago committed by GitHub
parent 761fe19e5f
commit e862f90e34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -173,17 +173,17 @@ func (r *linuxRouter) Set(cfg *Config) error {
return err
}
newAddrs, err := cidrDiff("addr", r.addrs, cfg.LocalAddrs, r.addAddress, r.delAddress, r.logf)
newRoutes, err := cidrDiff("route", r.routes, cfg.Routes, r.addRoute, r.delRoute, r.logf)
if err != nil {
return err
}
r.addrs = newAddrs
r.routes = newRoutes
newRoutes, err := cidrDiff("route", r.routes, cfg.Routes, r.addRoute, r.delRoute, r.logf)
newAddrs, err := cidrDiff("addr", r.addrs, cfg.LocalAddrs, r.addAddress, r.delAddress, r.logf)
if err != nil {
return err
}
r.routes = newRoutes
r.addrs = newAddrs
switch {
case cfg.SNATSubnetRoutes == r.snatSubnetRoutes:

Loading…
Cancel
Save