mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 07:40:56 +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
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -347,14 +347,14 @@ func (this *NFTablesFirewall) DropSourceIP(ip string, timeoutSeconds int, async
 | 
			
		||||
		return errors.New("invalid ip '" + ip + "'")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// 避免短时间内重复添加
 | 
			
		||||
	if this.checkLatestIP(ip) {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// 尝试关闭连接
 | 
			
		||||
	conns.SharedMap.CloseIPConns(ip)
 | 
			
		||||
 | 
			
		||||
	// 避免短时间内重复添加
 | 
			
		||||
	if async && this.checkLatestIP(ip) {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if async {
 | 
			
		||||
		select {
 | 
			
		||||
		case this.dropIPQueue <- &blockIPItem{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user