diff --git a/stp/stp_intf.c b/stp/stp_intf.c index 982a0fb..0122f80 100755 --- a/stp/stp_intf.c +++ b/stp/stp_intf.c @@ -594,12 +594,20 @@ int stp_intf_event_mgr_init(void) STP_LOG_CRITICAL("netlink init failed"); sys_assert(0); } - - if (stp_netlink_recv_all(g_stpd_netlink_handle) == -1) + do { - STP_LOG_CRITICAL("error in intf db creation"); - sys_assert(0); + if (stp_netlink_recv_all(g_stpd_netlink_handle) == -1) + { + STP_LOG_CRITICAL("error in intf db creation"); + sys_assert(0); + } + if(!g_max_stp_port) + { + STP_LOG_INFO("Max port is 0,retry after 1 sec"); + sleep(1); + } } + while(g_max_stp_port == 0 ); g_max_stp_port = g_max_stp_port * 2; // Phy Ports + LAG STP_LOG_INFO("intf db done. max port %d", g_max_stp_port); diff --git a/stp/stp_mgr.c b/stp/stp_mgr.c index 21f438a..7739273 100755 --- a/stp/stp_mgr.c +++ b/stp/stp_mgr.c @@ -1899,15 +1899,14 @@ static void stpmgr_process_ipc_msg(STP_IPC_MSG *msg, int len, struct sockaddr_un } case STP_BRIDGE_CONFIG: { - stpmgr_process_bridge_config_msg(msg->data); - /*if(msg->proto_mode == L2_PVSTP) + if(msg->proto_mode == L2_PVSTP) { stpmgr_process_bridge_config_msg(msg->data); } else if(msg->proto_mode == L2_MSTP) { mstpmgr_process_bridge_config_msg(msg->data); - }*/ + } break; } case STP_VLAN_CONFIG: @@ -1922,15 +1921,14 @@ static void stpmgr_process_ipc_msg(STP_IPC_MSG *msg, int len, struct sockaddr_un } case STP_PORT_CONFIG: { - stpmgr_process_intf_config_msg(msg->data); - /*if(msg->proto_mode == L2_PVSTP) + if(msg->proto_mode == L2_PVSTP) { stpmgr_process_intf_config_msg(msg->data); } else if(msg->proto_mode == L2_MSTP) { mstpmgr_process_intf_config_msg(msg->data); - }*/ + } break; } case STP_VLAN_MEM_CONFIG: @@ -1964,7 +1962,8 @@ static void stpmgr_process_ipc_msg(STP_IPC_MSG *msg, int len, struct sockaddr_un } case STP_MST_VLAN_PORT_LIST_CONFIG: { - mstpmgr_process_vlan_mem_config_msg(msg->data); + if (msg->proto_mode == L2_MSTP) + mstpmgr_process_vlan_mem_config_msg(msg->data); break; } case STP_MST_INST_PORT_CONFIG: