mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net: filter destination addresses when source address is specified
This change filters out destination addresses by address family when source address is specified to avoid running Dial operation with wrong addressing scopes. Fixes #11837. Change-Id: I10b7a1fa325add2cd8ed58f105d527700a10d342 Reviewed-on: https://go-review.googlesource.com/20586 Reviewed-by: Paul Marks <pmarks@google.com>
This commit is contained in:
parent
76b724cc63
commit
790053b25e
6 changed files with 176 additions and 48 deletions
|
|
@ -96,7 +96,7 @@ second:
|
|||
goto third
|
||||
}
|
||||
switch nestedErr {
|
||||
case errCanceled, errClosing, errMissingAddress:
|
||||
case errCanceled, errClosing, errMissingAddress, errNoSuitableAddress:
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unexpected type on 2nd nested level: %T", nestedErr)
|
||||
|
|
@ -416,7 +416,7 @@ second:
|
|||
goto third
|
||||
}
|
||||
switch nestedErr {
|
||||
case errCanceled, errClosing, errTimeout, ErrWriteToConnected, io.ErrUnexpectedEOF:
|
||||
case errCanceled, errClosing, errMissingAddress, errTimeout, ErrWriteToConnected, io.ErrUnexpectedEOF:
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unexpected type on 2nd nested level: %T", nestedErr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue