Skip to content

Commit

Permalink
[fpmsyncd] Skip routes to eth0 or docker0 (sonic-net#1606)
Browse files Browse the repository at this point in the history
Fix sonic-net#6483

An FRR behavior change from 7.2 to 7.5 makes FRR update the default route to eth0 in interface up/down events. Skipping routes to eth0 or docker0 to avoid such behavior.
  • Loading branch information
shi-su authored Jan 25, 2021
1 parent f4c3579 commit f4e8245
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions fpmsyncd/routesync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,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",
destipprefix, nexthops.c_str(), ifnames.c_str());
return;
}
}

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

0 comments on commit f4e8245

Please sign in to comment.