Make dial fail on interface bind err

This commit is contained in:
Fangliding
2026-10-15 14:54:15 +08:00
parent 701af60772
commit dda0fa2bde
6 changed files with 66 additions and 28 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ func applyOutboundSocketOptions(network string, address string, fd uintptr, conf
if config.Interface != "" {
if err := syscall.BindToDevice(int(fd), config.Interface); err != nil {
return errors.New("failed to set Interface").Base(err)
return NewBindError(err)
}
}