mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
fix: UDP插件改用 conn.SetDeadline 替代类型断言
This commit is contained in:
@@ -34,9 +34,7 @@ func (p *BACnetPlugin) Scan(ctx context.Context, info *common.HostInfo, session
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
if dl, ok := conn.(interface{ SetReadDeadline(time.Time) error }); ok {
|
||||
_ = dl.SetReadDeadline(time.Now().Add(timeout))
|
||||
}
|
||||
_ = conn.SetDeadline(time.Now().Add(timeout))
|
||||
|
||||
if _, err := conn.Write(bacnetWhoIs); err != nil {
|
||||
return &ScanResult{Success: false, Service: "bacnet"}
|
||||
|
||||
Reference in New Issue
Block a user