File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -440,7 +440,8 @@ func (nrc *NetworkRoutingController) injectRoute(path *table.Path) error {
440440
441441 // create IPIP tunnels only when node is not in same subnet or overlay-type is set to 'full'
442442 // prevent creation when --override-nexthop=true as well
443- if (! sameSubnet || nrc .overlayType == "full" ) && ! nrc .overrideNextHop {
443+ // if the user has disabled overlays, don't create tunnels
444+ if (! sameSubnet || nrc .overlayType == "full" ) && ! nrc .overrideNextHop && nrc .enableOverlays {
444445 // create ip-in-ip tunnel and inject route as overlay is enabled
445446 var link netlink.Link
446447 var err error
@@ -488,7 +489,7 @@ func (nrc *NetworkRoutingController) injectRoute(path *table.Path) error {
488489 Dst : dst ,
489490 Protocol : 0x11 ,
490491 }
491- } else {
492+ } else if sameSubnet {
492493 route = & netlink.Route {
493494 Dst : dst ,
494495 Gw : nexthop ,
You can’t perform that action at this time.
0 commit comments