gvisor/pkg/tcpip/network
Sepehr Raissian c17ea8c6e2 Block for link address resolution
Previously, if address resolution for UDP or Ping sockets required sending
packets using Write in Transport layer, Resolve would return ErrWouldBlock
and Write would return ErrNoLinkAddress. Meanwhile startAddressResolution
would run in background. Further calls to Write using same address would also
return ErrNoLinkAddress until resolution has been completed successfully.

Since Write is not allowed to block and System Calls need to be
interruptible in System Call layer, the caller to Write is responsible for
blocking upon return of ErrWouldBlock.

Now, when startAddressResolution is called a notification channel for
the completion of the address resolution is returned.
The channel will traverse up to the calling function of Write as well as
ErrNoLinkAddress. Once address resolution is complete (success or not) the
channel is closed. The caller would call Write again to send packets and
check if address resolution was compeleted successfully or not.

Fixes google/gvisor#5

Change-Id: Idafaf31982bee1915ca084da39ae7bd468cebd93
PiperOrigin-RevId: 214962200
2018-09-28 11:00:16 -07:00
..
arp Pass buffer.Prependable by value 2018-09-14 15:23:58 -07:00
fragmentation Always pass buffer.VectorisedView by value 2018-09-12 21:57:55 -07:00
hash
ipv4 Pass buffer.Prependable by value 2018-09-14 15:23:58 -07:00
ipv6 Block for link address resolution 2018-09-28 11:00:16 -07:00
BUILD
ip_test.go Remove buffer.Prependable.UsedBytes 2018-09-14 16:39:56 -07:00