mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-10 12:30:25 +08:00
修复无法添加IP到本地防火墙的问题
This commit is contained in:
@@ -170,7 +170,7 @@ func (this *Firewalld) DropSourceIP(ip string, timeoutSeconds int, async bool) e
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 避免短时间内重复添加
|
// 避免短时间内重复添加
|
||||||
if this.checkLatestIP(ip) {
|
if async && this.checkLatestIP(ip) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -347,14 +347,14 @@ func (this *NFTablesFirewall) DropSourceIP(ip string, timeoutSeconds int, async
|
|||||||
return errors.New("invalid ip '" + ip + "'")
|
return errors.New("invalid ip '" + ip + "'")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 避免短时间内重复添加
|
|
||||||
if this.checkLatestIP(ip) {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// 尝试关闭连接
|
// 尝试关闭连接
|
||||||
conns.SharedMap.CloseIPConns(ip)
|
conns.SharedMap.CloseIPConns(ip)
|
||||||
|
|
||||||
|
// 避免短时间内重复添加
|
||||||
|
if async && this.checkLatestIP(ip) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
if async {
|
if async {
|
||||||
select {
|
select {
|
||||||
case this.dropIPQueue <- &blockIPItem{
|
case this.dropIPQueue <- &blockIPItem{
|
||||||
|
|||||||
Reference in New Issue
Block a user