/* Init the MLD data of the IP6 service instance. Configure MNP to receive ALL SYSTEM multicast. */
EFI_STATUS Ip6InitMld(IN IP6_SERVICE *IpSb)
/* Init the MLD data of the IP6 service instance. Configure MNP to receive ALL SYSTEM multicast. */
EFI_STATUS Ip6InitMld(IN IP6_SERVICE *IpSb)
{
  EFI_IPv6_ADDRESS  AllNodes;
  IP6_MLD_GROUP     *Group;
  EFI_STATUS        Status;
  Ip6SetToAllNodeMulticast (FALSE, IP6_LINK_LOCAL_SCOPE, &AllNodes);
  Group = Ip6CreateMldEntry (IpSb, &AllNodes, (UINT32)IP6_INFINIT_LIFETIME);
  if (Group == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }
  Status = Ip6GetMulticastMac (IpSb->Mnp, &AllNodes, &Group->Mac);
  if (EFI_ERROR (Status)) {
    goto ERROR;
  }
  Status = IpSb->Mnp->Groups (IpSb->Mnp, TRUE, &Group->Mac);
  if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {
    goto ERROR;
  }
  return EFI_SUCCESS;
ERROR:
  RemoveEntryList (&Group->Link);
  FreePool (Group);
  return Status;
}