fix: should reset kernel program outbound alive status every reload

This commit is contained in:
mzz2017
2023-03-02 21:28:30 +08:00
parent 1eaf4bb7f6
commit 0433f8d5da
2 changed files with 18 additions and 12 deletions

View File

@ -23,13 +23,15 @@ func FormatL4Proto(l4proto uint8) string {
return strconv.Itoa(int(l4proto))
}
func (c *controlPlaneCore) OutboundAliveChangeCallback(outbound uint8) func(alive bool, networkType *dialer.NetworkType) {
return func(alive bool, networkType *dialer.NetworkType) {
c.log.WithFields(logrus.Fields{
"alive": alive,
"network": networkType.StringWithoutDns(),
"outbound": c.outboundId2Name[outbound],
}).Warnf("Outbound alive state changed, notify the kernel program.")
func (c *controlPlaneCore) OutboundAliveChangeCallback(outbound uint8) func(alive bool, networkType *dialer.NetworkType, isInit bool) {
return func(alive bool, networkType *dialer.NetworkType, isInit bool) {
if !isInit {
c.log.WithFields(logrus.Fields{
"alive": alive,
"network": networkType.StringWithoutDns(),
"outbound": c.outboundId2Name[outbound],
}).Warnf("Outbound alive state changed, notify the kernel program.")
}
value := uint32(0)
if alive {