mirror of
https://github.com/SunBK201/UA3F.git
synced 2025-12-19 10:17:31 +00:00
fix: enhance nfqueue detection to account for DESYNC rules
This commit is contained in:
parent
97c9371aef
commit
96d4917fae
@ -111,10 +111,14 @@ func (s *Server) detectNfqueue(ipt *iptables.IPTables) (pos int, exists bool) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, false
|
return 0, false
|
||||||
}
|
}
|
||||||
|
lastIndex := -1
|
||||||
for i, rule := range rules {
|
for i, rule := range rules {
|
||||||
if strings.Contains(rule, "NFQUEUE") {
|
if strings.Contains(rule, "NFQUEUE") {
|
||||||
return i + 1, true
|
lastIndex = max(lastIndex, i)
|
||||||
|
}
|
||||||
|
if strings.Contains(rule, "DESYNC") {
|
||||||
|
lastIndex = max(lastIndex, i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0, false
|
return lastIndex + 1, lastIndex != -1
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user