Removing outdated netlink codes

This commit is contained in:
Cuong Manh Le
2026-01-22 13:01:59 +07:00
committed by Cuong Manh Le
parent f05519d1c8
commit 8d63a755ba
3 changed files with 0 additions and 42 deletions

View File

@@ -1,34 +0,0 @@
package cli
import (
"context"
"github.com/vishvananda/netlink"
"golang.org/x/sys/unix"
)
func (p *prog) watchLinkState(ctx context.Context) {
ch := make(chan netlink.LinkUpdate)
done := make(chan struct{})
defer close(done)
if err := netlink.LinkSubscribe(ch, done); err != nil {
mainLog.Load().Warn().Err(err).Msg("could not subscribe link")
return
}
for {
select {
case <-ctx.Done():
return
case lu := <-ch:
if lu.Change == 0xFFFFFFFF {
continue
}
if lu.Change&unix.IFF_UP != 0 {
mainLog.Load().Debug().Msgf("link state changed, re-bootstrapping")
for _, uc := range p.cfg.Upstream {
uc.ReBootstrap()
}
}
}
}
}

View File

@@ -1,7 +0,0 @@
//go:build !linux
package cli
import "context"
func (p *prog) watchLinkState(ctx context.Context) {}

View File

@@ -537,7 +537,6 @@ func (p *prog) run(reload bool, reloadCh chan struct{}) {
defer wg.Done()
p.runClientInfoDiscover(ctx)
}()
go p.watchLinkState(ctx)
}
if !reload {