summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-11-06 09:52:00 +0000
committergVisor bot <gvisor-bot@google.com>2020-11-06 09:52:00 +0000
commitde70ee3adac521f19bd9ba9749876911f1a4ff5b (patch)
treed8ac7dfe4a8a4289d75210774fafdce237360765 /pkg
parentb3337f75897ef1e7df757357c01bbc714f17104f (diff)
parent955e09dfbdb8a4cdae0a0b625001a567f6f15758 (diff)
Merge release-20201030.0-40-g955e09dfb (automated)
Diffstat (limited to 'pkg')
-rw-r--r--pkg/tcpip/transport/udp/endpoint.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/udp/endpoint.go b/pkg/tcpip/transport/udp/endpoint.go
index 56bdf6c34..9bcb918bb 100644
--- a/pkg/tcpip/transport/udp/endpoint.go
+++ b/pkg/tcpip/transport/udp/endpoint.go
@@ -487,6 +487,11 @@ func (e *endpoint) write(p tcpip.Payloader, opts tcpip.WriteOptions) (int64, <-c
nicID = e.BindNICID
}
+ if to.Port == 0 {
+ // Port 0 is an invalid port to send to.
+ return 0, nil, tcpip.ErrInvalidEndpointState
+ }
+
dst, netProto, err := e.checkV4MappedLocked(*to)
if err != nil {
return 0, nil, err