From d59dd798cf2f9e9056074824455bcf3986f45716 Mon Sep 17 00:00:00 2001 From: Kaike Wan Date: Mon, 5 May 2014 11:43:20 -0700 Subject: [PATCH] ibacm/prov: Re-initialize the multicast dest before joining the multicast group If the provider has already registered for a multicast group, it should free the address handle before reregistering again. Signed-off-by: Kaike Wan Signed-off-by: Sean Hefty --- src/acm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/acm.c b/src/acm.c index 88dd540..cf3246c 100644 --- a/src/acm.c +++ b/src/acm.c @@ -1658,6 +1658,12 @@ static void acmp_ep_join(struct acmp_ep *ep) port = ep->port; acm_log(1, "%s\n", ep->id_string); + if (ep->mc_dest[0].state == ACMP_READY && ep->mc_dest[0].ah) { + ibv_detach_mcast(ep->qp, &ep->mc_dest[0].mgid, + ntohs(ep->mc_dest[0].av.dlid)); + ibv_destroy_ah(ep->mc_dest[0].ah); + ep->mc_dest[0].ah = NULL; + } ep->mc_cnt = 0; acmp_join_group(ep, &port->base_gid, 0, 0, 0, min_rate, min_mtu); -- 2.46.0