func (r *Route) Resolve(waker *sleep.Waker) (<-chan struct{}, *tcpip.Error) {
	if !r.IsResolutionRequired() {
		return nil, nil
	}
	nextAddr := r.NextHop
	if nextAddr == "" {
		if r.RemoteAddress == r.LocalAddress {
			r.RemoteLinkAddress = r.LocalLinkAddress
			return nil, nil
		}
		nextAddr = r.RemoteAddress
	}
	linkAddr, ch, err := r.ref.linkCache.GetLinkAddress(r.ref.nic.ID(), nextAddr, r.LocalAddress, r.NetProto, waker)
	if err != nil {
		return ch, err
	}
	r.RemoteLinkAddress = linkAddr
	return nil, nil
}
Resolve attempts to resolve the link address if necessary. Returns ErrWouldBlock in
case address resolution requires blocking, e.g. wait for ARP reply. Waker is
notified when address resolution is complete (success or not).

If address resolution is required, ErrNoLinkAddress and a notification channel is
returned for the top level caller to block. Channel is closed once address resolution
is complete (success or not).
package stack
import (
	"github.com/google/netstack/sleep"
	"github.com/google/netstack/tcpip"
	"github.com/google/netstack/tcpip/buffer"
	"github.com/google/netstack/tcpip/header"
)
type Route struct {
	RemoteAddress tcpip.Address
	RemoteLinkAddress tcpip.LinkAddress
	LocalAddress tcpip.Address
	LocalLinkAddress tcpip.LinkAddress
	NextHop tcpip.Address
	NetProto tcpip.NetworkProtocolNumber
	ref *referencedNetworkEndpoint
	Loop PacketLooping
}
func makeRoute(netProto tcpip.NetworkProtocolNumber, localAddr, remoteAddr tcpip.Address, localLinkAddr tcpip.LinkAddress, ref *referencedNetworkEndpoint, handleLocal, multicastLoop bool) Route {
	loop := PacketOut
	if handleLocal && localAddr != "" && remoteAddr == localAddr {
		loop = PacketLoop
	} else if multicastLoop && (header.IsV4MulticastAddress(remoteAddr) || header.IsV6MulticastAddress(remoteAddr)) {
		loop |= PacketLoop
	} else if remoteAddr == header.IPv4Broadcast {
		loop |= PacketLoop
	}
	return Route{
		NetProto:         netProto,
		LocalAddress:     localAddr,
		LocalLinkAddress: localLinkAddr,
		RemoteAddress:    remoteAddr,
		ref:              ref,
		Loop:             loop,
	}
}
func (r *Route) NICID() tcpip.NICID {
	return r.ref.ep.NICID()
}
func (r *Route) MaxHeaderLength() uint16 {
	return r.ref.ep.MaxHeaderLength()
}
func (r *Route) Stats() tcpip.Stats {
	return r.ref.nic.stack.Stats()
}
func (r *Route) PseudoHeaderChecksum(protocol tcpip.TransportProtocolNumber, totalLen uint16) uint16 {
	return header.PseudoHeaderChecksum(protocol, r.LocalAddress, r.RemoteAddress, totalLen)
}
func (r *Route) Capabilities() LinkEndpointCapabilities {
	return r.ref.ep.Capabilities()
}
func (r *Route) GSOMaxSize() uint32 {
	if gso, ok := r.ref.ep.(GSOEndpoint); ok {
		return gso.GSOMaxSize()
	}
	return 0
}