mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-20 00:04:26 +00:00
Sockopt: Cancel dialing after failed to bind interface, external controllers included such as TUN inbound's (#7173)
https://github.com/XTLS/Xray-core/pull/7161#issuecomment-6185101741 Fixes https://github.com/XTLS/Xray-core/issues/7160#issuecomment-6200788453 --------- Co-authored-by: Gleb <a1212gleb@gmail.com>
This commit is contained in:
@@ -28,3 +28,22 @@ func (v *SocketConfig) ParseTFOValue() int {
|
||||
}
|
||||
return tfo
|
||||
}
|
||||
|
||||
// Dial should fail on bind errors, return this to indicate such errors.
|
||||
type BindError struct {
|
||||
err error
|
||||
}
|
||||
|
||||
func (e *BindError) Unwrap() error {
|
||||
return e.err
|
||||
}
|
||||
|
||||
func (e *BindError) Error() string {
|
||||
return "failed to bind to interface: " + e.err.Error()
|
||||
}
|
||||
|
||||
func NewBindError(err error) *BindError {
|
||||
return &BindError{
|
||||
err: err,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user