summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsamuel.chou2013-11-04 10:38:13 +0800
committerJulien Lacour2013-11-07 11:08:49 +0100
commit67ed1633bdd46b5a0e857500aded37bb9ef32a04 (patch)
tree01c39117baaba3bb0e1316fb7d96a0c1a6419193
parent6eced8154010caa3caf58b89c921be3438b71289 (diff)
cleo/devkit/p1905: topology query msg sent on the wrong iface, refs #4251HEADmaster
-rw-r--r--cleopatre/devkit/p1905_managerd/src/cmdu_message_parse.c12
-rw-r--r--cleopatre/devkit/p1905_managerd/src/p1905_managerd.c13
2 files changed, 19 insertions, 6 deletions
diff --git a/cleopatre/devkit/p1905_managerd/src/cmdu_message_parse.c b/cleopatre/devkit/p1905_managerd/src/cmdu_message_parse.c
index 8debdf6a1d..116184886f 100644
--- a/cleopatre/devkit/p1905_managerd/src/cmdu_message_parse.c
+++ b/cleopatre/devkit/p1905_managerd/src/cmdu_message_parse.c
@@ -571,10 +571,12 @@ static int parse_topology_discovery_message(struct p1905_managerd_ctx *ctx,
memcpy(tpg_db->al_mac, al_mac_addr, ETH_ALEN);
memset(tpg_db->itf_mac, 0, ETH_ALEN);
- memcpy(al_mac, al_mac_addr, ETH_ALEN);
LIST_INSERT_HEAD(&(ctx->topology_entry.tpddb_head), tpg_db, tpddb_entry);
}
+ /* send topology query when receive topology response */
+ memcpy(al_mac, al_mac_addr, ETH_ALEN);
+
/*copy the interface mac into this component */
if(memcmp(tpg_db->itf_mac, mac_addr, ETH_ALEN))
{
@@ -584,7 +586,7 @@ static int parse_topology_discovery_message(struct p1905_managerd_ctx *ctx,
*notify = 1;
memcpy(tpg_db->itf_mac, mac_addr,ETH_ALEN);
}
-
+
/*use smac to check the receiving interface*/
if(-1 == get_receive_port_addr(smac, itf_mac_addr))
{
@@ -1558,9 +1560,8 @@ int parse_cmdu_message(struct p1905_managerd_ctx *ctx, unsigned char *buf,
break;
}
/*if receive topology discovery message in new device, query it*/
- if(need_query)
- {
- ctx->mid = ctx->mid + 1;
+ /* send topology query when get topology discovery */
+ ctx->mid = ctx->mid + 1;
#ifdef SUPPORT_WIFI
/* if a AP want to send unicast cmdu to STA, it needs to use interface mac
* instead of AL mac address
@@ -1577,7 +1578,6 @@ int parse_cmdu_message(struct p1905_managerd_ctx *ctx, unsigned char *buf,
#endif
insert_cmdu_txq(al_mac, ctx->p1905_al_mac_addr,
e_topology_query, ctx->mid);
- }
/*if local p1905.1 neighbor device info updated, notify*/
if(need_notify)
{
diff --git a/cleopatre/devkit/p1905_managerd/src/p1905_managerd.c b/cleopatre/devkit/p1905_managerd/src/p1905_managerd.c
index 028bf524c2..9c52e666ce 100644
--- a/cleopatre/devkit/p1905_managerd/src/p1905_managerd.c
+++ b/cleopatre/devkit/p1905_managerd/src/p1905_managerd.c
@@ -84,6 +84,19 @@ static void p1905_signal_handler(struct p1905_managerd_ctx *ctx)
update_non_1905_device_from_fdb(&(ctx->topology_entry.tpddb_head),
ctx->non_p1905_neighbor_dev);
+ /* if detect new non-1905.1 device join, send topology discovery
+ * this mechanism will let 1905.1 device discover soon
+ */
+ ctx->mid ++;
+ insert_cmdu_txq(p1905_multicast_address,ctx->plc0_mac_addr,\
+ e_topology_discovery,ctx->mid);
+ insert_cmdu_txq(p1905_multicast_address,ctx->eth0_mac_addr,\
+ e_topology_discovery,ctx->mid);
+#ifdef SUPPORT_WIFI
+ insert_cmdu_txq(p1905_multicast_address, ctx->wifi0_mac_addr,\
+ e_topology_discovery, ctx->mid);
+#endif
+
/* use is_topology_changed() to detect any non-1905.1 neighbor
* device joined/removed. if yes, need to send notify.
*/