mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-25 20:51:52 +08:00
fix: UDP插件改用 conn.SetDeadline 替代类型断言
This commit is contained in:
@@ -53,9 +53,7 @@ func (p *IPMIPlugin) rmcpPing(ctx context.Context, target string, timeout time.D
|
||||
0x00, // data length = 0
|
||||
}
|
||||
|
||||
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(ping); err != nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user