Skip to content

Commit

Permalink
[Teamdmgrd]Fix "teamd cannot start when port channel was down before …
Browse files Browse the repository at this point in the history
…warm reboot" issue (sonic-net#1171)

* during warm-reboot teamd need to use same system-id before warm-reboot

Signed-off-by: shine.chen <[email protected]>

* refine per review comment

Signed-off-by: shine.chen <[email protected]>

* skip saved pdu on negotiation stage

Signed-off-by: shine.chen <[email protected]>

* reformat teammgr file
  • Loading branch information
shine4chen authored and lguohan committed Jan 30, 2020
1 parent eceb423 commit da89cf2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cfgmgr/teammgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,19 @@ task_process_status TeamMgr::addLag(const string &alias, int min_links, bool fal
while (getline(aliasfile, line))
{
ifstream memberfile(dump_path + line, ios::binary);
uint8_t mac_temp[ETHER_ADDR_LEN];
uint8_t mac_temp[ETHER_ADDR_LEN] = {0};
uint8_t null_mac[ETHER_ADDR_LEN] = {0};

if (!memberfile.is_open())
continue;

memberfile.seekg(partner_system_id_offset, std::ios::beg);
memberfile.read(reinterpret_cast<char*>(mac_temp), ETHER_ADDR_LEN);

/* During negotiation stage partner info of pdu is empty , skip it */
if (memcmp(mac_temp, null_mac, ETHER_ADDR_LEN) == 0)
continue;

mac_boot = MacAddress(mac_temp);
break;
}
Expand Down

0 comments on commit da89cf2

Please sign in to comment.