mirror of https://github.com/Dreamacro/clash.git
Feature: PROCESS-NAME support freebsd 13, fix panic on unsupported platforms (#1351)
This commit is contained in:
parent
a9cbd9ec98
commit
936b7012ba
|
@ -30,6 +30,10 @@ func findProcessName(network string, ip net.IP, srcPort int) (string, error) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if defaultSearcher == nil {
|
||||||
|
return "", ErrPlatformNotSupport
|
||||||
|
}
|
||||||
|
|
||||||
var spath string
|
var spath string
|
||||||
isTCP := network == TCP
|
isTCP := network == TCP
|
||||||
switch network {
|
switch network {
|
||||||
|
@ -190,6 +194,8 @@ func newSearcher(major int) *searcher {
|
||||||
udpInpOffset: 8,
|
udpInpOffset: 8,
|
||||||
}
|
}
|
||||||
case 12:
|
case 12:
|
||||||
|
fallthrough
|
||||||
|
case 13:
|
||||||
s = &searcher{
|
s = &searcher{
|
||||||
headSize: 64,
|
headSize: 64,
|
||||||
tcpItemSize: 744,
|
tcpItemSize: 744,
|
||||||
|
|
Loading…
Reference in New Issue