summaryrefslogtreecommitdiffhomepage
path: root/pkg/syserr/netstack.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-02-12 00:07:09 +0000
committergVisor bot <gvisor-bot@google.com>2021-02-12 00:07:09 +0000
commit2cb6129a78c570821ab7ecee012ba8862dfa7e96 (patch)
tree7084d1ba860f45bffe96451208b83c7450ae945d /pkg/syserr/netstack.go
parentdf399e224e510350132497e6a96968c64251ba7c (diff)
parentc39284f457383dabd52f468a10072ca6d2211cbb (diff)
Merge release-20210201.0-89-gc39284f45 (automated)
Diffstat (limited to 'pkg/syserr/netstack.go')
-rw-r--r--pkg/syserr/netstack.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/syserr/netstack.go b/pkg/syserr/netstack.go
index a6a91e064..0b9139570 100644
--- a/pkg/syserr/netstack.go
+++ b/pkg/syserr/netstack.go
@@ -21,6 +21,8 @@ import (
"gvisor.dev/gvisor/pkg/tcpip"
)
+// LINT.IfChange
+
// Mapping for tcpip.Error types.
var (
ErrUnknownProtocol = New((&tcpip.ErrUnknownProtocol{}).String(), linux.EINVAL)
@@ -48,6 +50,7 @@ var (
ErrBroadcastDisabled = New((&tcpip.ErrBroadcastDisabled{}).String(), linux.EACCES)
ErrNotPermittedNet = New((&tcpip.ErrNotPermitted{}).String(), linux.EPERM)
ErrBadBuffer = New((&tcpip.ErrBadBuffer{}).String(), linux.EFAULT)
+ ErrMalformedHeader = New((&tcpip.ErrMalformedHeader{}).String(), linux.EINVAL)
)
// TranslateNetstackError converts an error from the tcpip package to a sentry
@@ -130,7 +133,11 @@ func TranslateNetstackError(err tcpip.Error) *Error {
return ErrAddressFamilyNotSupported
case *tcpip.ErrBadBuffer:
return ErrBadBuffer
+ case *tcpip.ErrMalformedHeader:
+ return ErrMalformedHeader
default:
panic(fmt.Sprintf("unknown error %T", err))
}
}
+
+// LINT.ThenChange(../tcpip/errors.go)