Skip to content

Commit c1b4b40

Browse files
author
novikauanton
authored
support port isolation group in BFN platform (#1940)
Signed-off-by: Anton <[email protected]>
1 parent c78aa1b commit c1b4b40

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

mclagsyncd/mclaglink.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "mclagsyncd/mclaglink.h"
3232
#include "mclagsyncd/mclag.h"
3333
#include <set>
34+
#include <unordered_set>
3435
#include <algorithm>
3536
#include "macaddress.h"
3637
#include <string>
@@ -188,8 +189,13 @@ void MclagLink::mclagsyncdFetchMclagInterfaceConfigFromConfigdb()
188189

189190
void MclagLink::setPortIsolate(char *msg)
190191
{
191-
char *platform = getenv("platform");
192-
if ((NULL != platform) && (strstr(platform, BRCM_PLATFORM_SUBSTRING)))
192+
static const unordered_set<string> supported {
193+
BRCM_PLATFORM_SUBSTRING,
194+
BFN_PLATFORM_SUBSTRING
195+
};
196+
197+
const char *platform = getenv("platform");
198+
if (platform != nullptr && supported.find(string(platform)) != supported.end())
193199
{
194200
mclag_sub_option_hdr_t *op_hdr = NULL;
195201
string isolate_src_port;

mclagsyncd/mclaglink.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@
5050
#endif /* INET_ADDRSTRLEN */
5151

5252
#define MAX_L_PORT_NAME 20
53+
5354
#define BRCM_PLATFORM_SUBSTRING "broadcom"
55+
#define BFN_PLATFORM_SUBSTRING "barefoot"
5456

5557
using namespace std;
5658

0 commit comments

Comments
 (0)