code: func (e *endpoint) WritePacket(r *stack.Route, _ *stack.GSO, hdr buffer.Prependable, payload buffer.VectorisedView, protocol tcpip.NetworkProtocolNumber) *tcpip.Error {
  	// Add the ethernet header here.
  	eth := header.Ethernet(hdr.Prepend(header.EthernetMinimumSize))
  	ethHdr := &header.EthernetFields{
  		DstAddr: r.RemoteLinkAddress,
  		Type:    protocol,
  	}
  	if r.LocalLinkAddress != "" {
  		ethHdr.SrcAddr = r.LocalLinkAddress
  	} else {
  		ethHdr.SrcAddr = e.addr
  	}
  	eth.Encode(ethHdr)
  
  	v := payload.ToView()
  	// Transmit the packet.
  	e.mu.Lock()
  	ok := e.tx.transmit(hdr.View(), v)
  	e.mu.Unlock()
  
  	if !ok {
  		return tcpip.ErrWouldBlock
  	}
  
  	return nil
  }
docs: // WritePacket writes outbound packets to the file descriptor. If it is not
  // currently writable, the packet is dropped.