mirror of
https://github.com/daeuniverse/dae.git
synced 2025-03-10 04:47:25 +07:00
optimize: allow to bind nothing
This commit is contained in:
parent
2d8ce4a096
commit
a9709d2a57
@ -150,7 +150,7 @@ func newControlPlane(log *logrus.Logger, bpf interface{}, conf *config.Config) (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(conf.Global.LanInterface) == 0 && len(conf.Global.WanInterface) == 0 {
|
if len(conf.Global.LanInterface) == 0 && len(conf.Global.WanInterface) == 0 {
|
||||||
return nil, fmt.Errorf("LanInterface and WanInterface cannot both be empty")
|
log.Warnln("No binding interface.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deep copy a conf to avoid modification.
|
// Deep copy a conf to avoid modification.
|
||||||
|
@ -178,8 +178,6 @@ func (p bpfIfParams) CheckVersionRequirement(version *internal.Version) (err err
|
|||||||
type loadBpfOptions struct {
|
type loadBpfOptions struct {
|
||||||
PinPath string
|
PinPath string
|
||||||
CollectionOptions *ebpf.CollectionOptions
|
CollectionOptions *ebpf.CollectionOptions
|
||||||
BindLan bool
|
|
||||||
BindWan bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func fullLoadBpfObjects(
|
func fullLoadBpfObjects(
|
||||||
|
@ -131,8 +131,6 @@ func NewControlPlane(
|
|||||||
if err = fullLoadBpfObjects(log, bpf, &loadBpfOptions{
|
if err = fullLoadBpfObjects(log, bpf, &loadBpfOptions{
|
||||||
PinPath: pinPath,
|
PinPath: pinPath,
|
||||||
CollectionOptions: collectionOpts,
|
CollectionOptions: collectionOpts,
|
||||||
BindLan: len(global.LanInterface) > 0,
|
|
||||||
BindWan: len(global.WanInterface) > 0,
|
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
if log.Level == logrus.PanicLevel {
|
if log.Level == logrus.PanicLevel {
|
||||||
log.Panicln(err)
|
log.Panicln(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user