/* Process the ICMP error packet. If it is an ICMP redirect packet, update call Ip4ProcessIcmpRedirect to update the IP instance's route cache, otherwise, deliver the packet to upper layer. */
EFI_STATUS Ip4ProcessIcmpError(IN IP4_SERVICE *IpSb, IN IP4_HEAD *Head, IN NET_BUF *Packet)
/* Process the ICMP error packet. If it is an ICMP redirect packet, update call Ip4ProcessIcmpRedirect to update the IP instance's route cache, otherwise, deliver the packet to upper layer. */
EFI_STATUS Ip4ProcessIcmpError(IN IP4_SERVICE *IpSb, IN IP4_HEAD *Head, IN NET_BUF *Packet)
{
  IP4_ICMP_ERROR_HEAD  Icmp;
  if (Packet->TotalSize < sizeof (Icmp)) {
    NetbufFree (Packet);
    return EFI_INVALID_PARAMETER;
  }
  NetbufCopy (Packet, 0, sizeof (Icmp), (UINT8 *)&Icmp);
  if (Icmp.Head.Type == ICMP_REDIRECT) {
    return Ip4ProcessIcmpRedirect (IpSb, Head, Packet, &Icmp);
  }
  IP4_GET_CLIP_INFO (Packet)->Status = EFI_ICMP_ERROR;
  return Ip4Demultiplex (IpSb, Head, Packet, NULL, 0);
}