Finalmask: Fix panic when udpHop or xicmp fails; Restore udpHop's default interval (#6808)

https://github.com/XTLS/Xray-core/pull/6808#pullrequestreview-5324529175

---------

Co-authored-by: 风扇滑翔翼 <Fangliding.fshxy@outlook.com>
This commit is contained in:
Esko Mobius
2026-09-27 22:17:47 +00:00
committed by RPRX
co-authored by 风扇滑翔翼
parent 2953d44734
commit 7780db9bbe
2 changed files with 14 additions and 6 deletions
+9 -2
View File
@@ -942,12 +942,19 @@ func (c *UDPHop) Build() (proto.Message, error) {
}
return nil, errors.New("invalid ip ", ip)
}
interval := c.Interval
if interval.From == 0 && interval.To == 0 {
interval.From, interval.To = 30, 30
}
if interval.From < 5 {
return nil, errors.New("interval must be at least 5")
}
return &udphop.Config{
Local: local,
Remote: remote,
RemoteOnce: remoteOnce,
IntervalMin: int64(c.Interval.From),
IntervalMax: int64(c.Interval.To),
IntervalMin: int64(interval.From),
IntervalMax: int64(interval.To),
RemoteIPs: remoteIPs,
RemotePorts: c.RemotePorts.Build().Ports(),
}, nil