Merge cherrypicks of [2717020, 2715927, 2715928, 2714058, 2714059, 2717040, 2715929, 2716423, 2716424, 2715736, 2715737, 2715738] into oc-dr1-release

Change-Id: I880363ee994703251d4e21224d8f6b92c6657c4e
diff --git a/cld80211-lib/cld80211_lib.c b/cld80211-lib/cld80211_lib.c
index 491fb3e..5c8255b 100644
--- a/cld80211-lib/cld80211_lib.c
+++ b/cld80211-lib/cld80211_lib.c
@@ -225,7 +225,7 @@
 }
 
 
-static int get_multicast_id(struct cld80211_ctx *ctx, const char *group)
+static int get_multicast_id(struct cld80211_ctx *ctx, const char *group, bool sync_driver)
 {
 	struct family_data res = { group, -ENOENT };
 	struct nl_msg *nlmsg = nlmsg_alloc();
@@ -238,9 +238,11 @@
 	            CTRL_CMD_GETFAMILY, 0);
 	nla_put_string(nlmsg, CTRL_ATTR_FAMILY_NAME, "cld80211");
 
-	cld80211_send_recv_msg(ctx, nlmsg, family_handler, &res);
-	ALOGI("%s: nlctrl family id: %d group: %s mcast_id: %d", getprogname(),
-				   ctx->nlctrl_familyid, group, res.id);
+	if (sync_driver == true) {
+		cld80211_send_recv_msg(ctx, nlmsg, family_handler, &res);
+		ALOGI("%s: nlctrl family id: %d group: %s mcast_id: %d", getprogname(),
+				ctx->nlctrl_familyid, group, res.id);
+	}
 	nlmsg_free(nlmsg);
 	return res.id;
 }
@@ -252,7 +254,7 @@
 		ALOGE("%s: ctx/mcgroup is NULL: %s", getprogname(), __func__);
 		return 0;
 	}
-	int id = get_multicast_id(ctx, mcgroup);
+	int id = get_multicast_id(ctx, mcgroup, true);
 	if (id < 0) {
 		ALOGE("%s: Could not find group %s, errno: %d id: %d",
 		      getprogname(), mcgroup, errno, id);
@@ -275,7 +277,7 @@
 		ALOGE("%s: ctx/mcgroup is NULL: %s", getprogname(), __func__);
 		return 0;
 	}
-	int id = get_multicast_id(ctx, mcgroup);
+	int id = get_multicast_id(ctx, mcgroup, false);
 	if (id < 0) {
 		ALOGE("%s: Could not find group %s, errno: %d id: %d",
 		      getprogname(), mcgroup, errno, id);