Skip to content

Commit

Permalink
Adding FoU encapsulation over IPIP tunnel : added checks for restart …
Browse files Browse the repository at this point in the history
…and multi-node cases
  • Loading branch information
Kartik Raval authored and aauren committed Jul 3, 2023
1 parent af708b4 commit 55dc26b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkg/controllers/routing/network_routes_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,11 +767,16 @@ func (nrc *NetworkRoutingController) setupOverlayTunnel(tunnelName string, nextH

} else if nrc.overlayEncap == "fou" {

cmdArgs = append(cmdArgs, "fou", "add", "port", strconv.FormatInt(int64(nrc.overlayEncapPort), 10), "ipproto", "4")
cmdArgs = append(cmdArgs, "fou", "show")
out, err := exec.Command("ip", cmdArgs...).CombinedOutput()
if err != nil {
return nil, fmt.Errorf("route not injected for the route advertised by the node %s "+
"Failed to set FoU tunnel port - error: %s, output: %s", tunnelName, err, string(out))
if err != nil || !strings.Contains(string(out), strconv.FormatInt(int64(nrc.overlayEncapPort), 10)) {
cmdArgs = ipBase
cmdArgs = append(cmdArgs, "fou", "add", "port", strconv.FormatInt(int64(nrc.overlayEncapPort), 10), "ipproto", "4")
out, err := exec.Command("ip", cmdArgs...).CombinedOutput()
if err != nil {
return nil, fmt.Errorf("route not injected for the route advertised by the node %s "+
"Failed to set FoU tunnel port - error: %s, output: %s", tunnelName, err, string(out))
}
}
cmdArgs = ipBase
cmdArgs = append(cmdArgs,
Expand Down

0 comments on commit 55dc26b

Please sign in to comment.