mirror of
https://github.com/daeuniverse/dae.git
synced 2025-07-24 23:00:16 +07:00
fix: should correctly set dialer alive property
This commit is contained in:
@ -5,10 +5,20 @@
|
||||
|
||||
package control
|
||||
|
||||
import "github.com/cilium/ebpf"
|
||||
import (
|
||||
"github.com/cilium/ebpf"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func (c *ControlPlaneCore) OutboundAliveChangeCallback(outbound uint8) func(alive bool, l4proto uint8, ipversion uint8) {
|
||||
return func(alive bool, l4proto uint8, ipversion uint8) {
|
||||
c.log.WithFields(logrus.Fields{
|
||||
"alive": alive,
|
||||
"l4proto": l4proto,
|
||||
"ipversion": ipversion,
|
||||
"outbound_id": outbound,
|
||||
}).Tracef("outbound alive state changed")
|
||||
|
||||
value := uint32(0)
|
||||
if alive {
|
||||
value = 1
|
||||
|
@ -206,6 +206,12 @@ getNew:
|
||||
}
|
||||
// If the udp endpoint has been not alive, remove it from pool and get a new one.
|
||||
if !isNew && !ue.Dialer.MustGetAlive(l4proto, ipversion) {
|
||||
c.log.WithFields(logrus.Fields{
|
||||
"src": src.String(),
|
||||
"l4proto": l4proto,
|
||||
"ipversion": ipversion,
|
||||
"dialer": ue.Dialer.Name(),
|
||||
}).Debugln("Old udp endpoint is not alive and removed")
|
||||
_ = DefaultUdpEndpointPool.Remove(src, ue)
|
||||
goto getNew
|
||||
}
|
||||
|
Reference in New Issue
Block a user