mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Refactor HandleControlPacket/SockError
...to remove the need for the transport layer to deduce the type of error it received. Rename HandleControlPacket to HandleError as HandleControlPacket only handles errors. tcpip.SockError now holds a tcpip.SockErrorCause interface that different errors can implement. PiperOrigin-RevId: 354994306
This commit is contained in:
committed by
gVisor bot
parent
cbcebfea80
commit
ebd3912c0f
@@ -2666,9 +2666,9 @@ func (s *socketOpsCommon) dequeueErr() *tcpip.SockError {
|
||||
}
|
||||
|
||||
// Update socket error to reflect ICMP errors in queue.
|
||||
if nextErr := so.PeekErr(); nextErr != nil && nextErr.ErrOrigin.IsICMPErr() {
|
||||
if nextErr := so.PeekErr(); nextErr != nil && nextErr.Cause.Origin().IsICMPErr() {
|
||||
so.SetLastError(nextErr.Err)
|
||||
} else if err.ErrOrigin.IsICMPErr() {
|
||||
} else if err.Cause.Origin().IsICMPErr() {
|
||||
so.SetLastError(nil)
|
||||
}
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user