Skip to content

Commit

Permalink
Do not ignore netlink messages on interfaces belong to LAG
Browse files Browse the repository at this point in the history
  • Loading branch information
liorghub committed Apr 18, 2022
1 parent 50d5be2 commit 2786614
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions portsyncd/linksync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <sys/socket.h>
#include <linux/if.h>
#include <netlink/route/link.h>
#include <netlink/route/link/bridge.h>
#include "logger.h"
#include "netmsg.h"
#include "dbconnector.h"
Expand Down Expand Up @@ -212,12 +213,19 @@ void LinkSync::onMsg(int nlmsg_type, struct nl_object *obj)
return;
}

/* If netlink for this port has master, we ignore that for now
* This could be the case where the port was removed from VLAN bridge
*/
/* Ignore netlink on interfaces belong to VLAN bridge */
if (master)
{
return;
LinkCache &linkCache = LinkCache::getInstance();
string masterName = linkCache.ifindexToName(master);
struct rtnl_link *masterLink = linkCache.getLinkByName(masterName.c_str());
bool isBridge = rtnl_link_is_bridge(masterLink);

if(isBridge)
{
return;

}
}

/* In the event of swss restart, it is possible to get netlink messages during bridge
Expand Down

0 comments on commit 2786614

Please sign in to comment.