/* Process the ICMPv6 error packet, and deliver the packet to upper layer. */
EFI_STATUS Ip6ProcessIcmpError(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
/* Process the ICMPv6 error packet, and deliver the packet to upper layer. */
EFI_STATUS Ip6ProcessIcmpError(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
{
  IP6_ICMP_ERROR_HEAD  Icmp;
  if (Packet->TotalSize < sizeof (Icmp)) {
    goto DROP;
  }
  NetbufCopy (Packet, 0, sizeof (Icmp), (UINT8 *)&Icmp);
  if (Icmp.Head.Type == ICMP_V6_PACKET_TOO_BIG) {
    return Ip6ProcessPacketTooBig (IpSb, Head, Packet);
  }
  IP6_GET_CLIP_INFO (Packet)->Status = EFI_ICMP_ERROR;
  return Ip6Demultiplex (IpSb, Head, Packet);
DROP:
  NetbufFree (Packet);
  Packet = NULL;
  return EFI_INVALID_PARAMETER;
}