Skip to content

Commit

Permalink
Implementation of minimal fallback mode needed especially for masquer…
Browse files Browse the repository at this point in the history
…ading
  • Loading branch information
TrekkieCoder committed Feb 1, 2024
1 parent 53c9936 commit 49ac0bc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion loxilb-ebpf
14 changes: 10 additions & 4 deletions loxinet/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ package loxinet
import (
"errors"
"fmt"
"net"

tk "github.com/loxilb-io/loxilib"

cmn "github.com/loxilb-io/loxilb/common"
opts "github.com/loxilb-io/loxilb/options"
tk "github.com/loxilb-io/loxilib"
"net"
)

// error codes
Expand Down Expand Up @@ -471,6 +470,13 @@ func (rt *Rt) DP(work DpWorkT) int {
return -1
}

if opts.Opts.FallBack {
if rtNet.IP.IsUnspecified() {
fmt.Printf("FALL BACK MODE\n\n\n\n")
return 0
}
}

if work == DpStatsGet {
nStat := new(StatDpWorkQ)
nStat.Work = work
Expand Down
1 change: 1 addition & 0 deletions options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ var Opts struct {
Rpc string `long:"rpc" description:"RPC mode for syncing - netrpc or grpc" default:"netrpc"`
K8sApi string `long:"k8s-api" description:"Enable k8s watcher(experimental)" default:"none"`
IPVSCompat bool `long:"ipvs-compat" description:"Enable ipvs-compat(experimental)"`
FallBack bool `long:"fallback" description:"Fallback to system default networking(experimental)"`
}

0 comments on commit 49ac0bc

Please sign in to comment.