Skip to content

Commit

Permalink
[Bridge] Disable MAC learning for Link Local Mulitcast Frames on the …
Browse files Browse the repository at this point in the history
…kernel bridge (#3162)

What I did
Disable MAC learning for Link Local Multicast Frames on the Linux Bridge

Why I did it
The 01:80:c2 link local frame is used to control the purpose. To disable the MAC learning for these frames to prevent MAC flap if there are multiple links between 2 switches.
  • Loading branch information
gord1306 authored May 23, 2024
1 parent de9baac commit 5ffb0b5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cfgmgr/vlanmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@ VlanMgr::VlanMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, c

EXEC_WITH_ERROR_THROW(echo_cmd_backup, res);
}

// not learn from link-local frames
// /bin/echo 1 > /sys/class/net/Bridge/bridge/no_linklocal_learn
const std::string no_ll_learn_cmd = std::string("")
+ ECHO_CMD + " 1 > /sys/class/net/" + DOT1Q_BRIDGE_NAME + "/bridge/no_linklocal_learn";

ret = swss::exec(no_ll_learn_cmd, res);
if (ret != 0) {
EXEC_WITH_ERROR_THROW(no_ll_learn_cmd, res);
}

}

bool VlanMgr::addHostVlan(int vlan_id)
Expand Down

0 comments on commit 5ffb0b5

Please sign in to comment.