summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/udp
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-01-28 14:42:15 +0000
committergVisor bot <gvisor-bot@google.com>2021-01-28 14:42:15 +0000
commit8226803c10705473fbe5bd31865a0775c9e1f171 (patch)
treef2583a682203bc35bab3462f7d872689876ffe72 /pkg/tcpip/transport/udp
parentd34fe8d385b0a28df5c7e6ccd8bb74c10c0c3dac (diff)
parent6012fe9b5965a2f285f2f99312e6cb7ae84b5fa8 (diff)
Merge release-20210125.0-12-g6012fe9b5 (automated)
Diffstat (limited to 'pkg/tcpip/transport/udp')
-rw-r--r--pkg/tcpip/transport/udp/endpoint.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/udp/endpoint.go b/pkg/tcpip/transport/udp/endpoint.go
index 4988ba29b..d2f7b6e85 100644
--- a/pkg/tcpip/transport/udp/endpoint.go
+++ b/pkg/tcpip/transport/udp/endpoint.go
@@ -480,6 +480,9 @@ func (e *endpoint) write(p tcpip.Payloader, opts tcpip.WriteOptions) (int64, *tc
// Reject destination address if it goes through a different
// NIC than the endpoint was bound to.
nicID := to.NIC
+ if nicID == 0 {
+ nicID = tcpip.NICID(e.ops.GetBindToDevice())
+ }
if e.BindNICID != 0 {
if nicID != 0 && nicID != e.BindNICID {
return 0, tcpip.ErrNoRoute