/* Remove a group address from the array of group addresses. Although the function doesn't assume the byte order of Group, the network byte order is used by the caller. */
EFI_STATUS Ip6RemoveGroup(IN OUT IP6_PROTOCOL *IpInstance, IN EFI_IPv6_ADDRESS *Group)
/* Remove a group address from the array of group addresses. Although the function doesn't assume the byte order of Group, the network byte order is used by the caller. */
EFI_STATUS Ip6RemoveGroup(IN OUT IP6_PROTOCOL *IpInstance, IN EFI_IPv6_ADDRESS *Group)
{
  UINT32  Index;
  UINT32  Count;
  Count = IpInstance->GroupCount;
  for (Index = 0; Index < Count; Index++) {
    if (EFI_IP6_EQUAL (IpInstance->GroupList + Index, Group)) {
      break;
    }
  }
  if (Index == Count) {
    return EFI_NOT_FOUND;
  }
  while (Index < Count - 1) {
    IP6_COPY_ADDRESS (IpInstance->GroupList + Index, IpInstance->GroupList + Index + 1);
    Index++;
  }
  ASSERT (IpInstance->GroupCount > 0);
  IpInstance->GroupCount--;
  return EFI_SUCCESS;
}