diff --git a/wgengine/router/router_linux.go b/wgengine/router/router_linux.go index 6e8d8576e..3ed702a3f 100644 --- a/wgengine/router/router_linux.go +++ b/wgengine/router/router_linux.go @@ -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: