From e7af660029a244b0dc10caf8cd5e2fc94476e83a Mon Sep 17 00:00:00 2001 From: Shi Su <67605788+shi-su@users.noreply.github.com> Date: Sun, 24 Jan 2021 17:12:23 -0800 Subject: [PATCH] [fpmsyncd] Skip routes to eth0 or docker0 (#1606) Fix Azure/sonic-buildimage#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. --- fpmsyncd/routesync.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fpmsyncd/routesync.cpp b/fpmsyncd/routesync.cpp index 8b61fbaa1c..30f6151e5e 100644 --- a/fpmsyncd/routesync.cpp +++ b/fpmsyncd/routesync.cpp @@ -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 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 fvVector; FieldValueTuple nh("nexthop", nexthops); FieldValueTuple idx("ifname", ifnames);