code: func (e *Endpoint) WritePacket(r *stack.Route, gso *stack.GSO, hdr buffer.Prependable, payload buffer.VectorisedView, protocol tcpip.NetworkProtocolNumber) *tcpip.Error {
  	if !e.writeGate.Enter() {
  		return nil
  	}
  
  	err := e.lower.WritePacket(r, gso, hdr, payload, protocol)
  	e.writeGate.Leave()
  	return err
  }
docs: // WritePacket implements stack.LinkEndpoint.WritePacket. It is called by
  // higher-level protocols to write packets. It only forwards packets to the
  // lower endpoint if Wait or WaitWrite haven't been called.