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

[fpmsyncd] Skip routes to eth0 or docker0 #1606

Merged
merged 2 commits into from
Jan 25, 2021
Merged
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
15 changes: 15 additions & 0 deletions fpmsyncd/routesync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,21 @@ void RouteSync::onRouteMsg(int nlmsg_type, struct nl_object *obj, char *vrf)
string nexthops = getNextHopGw(route_obj);
string ifnames = getNextHopIf(route_obj);

vector<string> alsv = tokenize(ifnames, ',');
for (auto alias : alsv)
{
/*
* An FRR behavior change from 7.2 to 7.5 makes FRR update default route to eth0 in interface
* up/down events. Skipping routes to eth0 or docker0 to avoid such behavior
*/
if (alias == "eth0" || alias == "docker0")
{
SWSS_LOG_NOTICE("Skip routes to eth0 or docker0: %s %s %s",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment, route updates can be in INFO level log.

destipprefix, nexthops.c_str(), ifnames.c_str());
return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take this as a example: At first route 0.0.0.0/0 had a multipath nexthop "Ethernet0,Ethernet1", and some minutes later it became "Ethernet0,Ethernet1,eth0". Last it becomes "eth0". Since the change filters all routes including the eth0 nexthop, in the example this changes prevent "Ethernet0,Ethernet1" from exiting the next-hop list in ASIC. This is a rare situation but I suggest to take this into consideration.

Copy link
Contributor

@lguohan lguohan Jan 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in our design, we would not have such mixed scenario.

}
}

vector<FieldValueTuple> fvVector;
FieldValueTuple nh("nexthop", nexthops);
FieldValueTuple idx("ifname", ifnames);
Expand Down