Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bridge mac setting and fix for mux statedb time format #1844

Merged
merged 1 commit into from
Aug 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cfgmgr/vlanmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ bool VlanMgr::setHostVlanMac(int vlan_id, const string &mac)
// The command should be generated as:
// /sbin/ip link set Vlan{{vlan_id}} address {{mac}}
ostringstream cmds;
cmds << IP_CMD " link set " VLAN_PREFIX + std::to_string(vlan_id) + " address " << shellquote(mac);
cmds << IP_CMD " link set " VLAN_PREFIX + std::to_string(vlan_id) + " address " << shellquote(mac) << " && "
IP_CMD " link set " DOT1Q_BRIDGE_NAME " address " << shellquote(mac);

std::string res;
EXEC_WITH_ERROR_THROW(cmds.str(), res);
Expand Down
12 changes: 11 additions & 1 deletion orchagent/muxorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,17 @@ void MuxCableOrch::updateMuxMetricState(string portName, string muxState, bool s
char buf[256];
std::strftime(buf, 256, "%Y-%b-%d %H:%M:%S.", &now_tm);

string time = string(buf) + to_string(micros);
/*
* Prepend '0's for 6 point precision
*/
const int precision = 6;
auto ms = to_string(micros);
if (ms.length() < precision)
{
ms.insert(ms.begin(), precision - ms.length(), '0');
}

string time = string(buf) + ms;

mux_metric_table_.hset(portName, msg, time);
}
Expand Down