Skip to content

Commit 01ec883

Browse files
authored
prevent IPIP tunnel creation when --override-nexthop=ture (#518)
1 parent 1db83ad commit 01ec883

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/controllers/routing/network_routes_controller.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,9 @@ func (nrc *NetworkRoutingController) injectRoute(path *table.Path) error {
364364
dst, _ := netlink.ParseIPNet(nlri.String())
365365
var route *netlink.Route
366366

367-
// check if the neighbour is in same subnet
368-
if !nrc.nodeSubnet.Contains(nexthop) {
367+
// check if the neighbour is in same subnet. If node is not in same subnet and --override-nexthop=false
368+
// only then create IPIP tunnels
369+
if !nrc.nodeSubnet.Contains(nexthop) && !nrc.overrideNextHop {
369370
tunnelName := generateTunnelName(nexthop.String())
370371
glog.Infof("Found node: " + nexthop.String() + " to be in different subnet.")
371372

0 commit comments

Comments
 (0)