From d559413eb02f050f1726fecb22722efb9991f51d Mon Sep 17 00:00:00 2001 From: Suman Kumar Date: Thu, 17 Dec 2020 04:40:08 -0800 Subject: [PATCH] preventing default fallback route lookup from user-defined VRF table to local table(default vrf). --- cfgmgr/vrfmgr.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cfgmgr/vrfmgr.cpp b/cfgmgr/vrfmgr.cpp index 25ca1253e3..1b620f34a5 100644 --- a/cfgmgr/vrfmgr.cpp +++ b/cfgmgr/vrfmgr.cpp @@ -11,7 +11,9 @@ #define VRF_TABLE_START 1001 #define VRF_TABLE_END 2000 -#define TABLE_LOCAL_PREF 1001 // after l3mdev-table +#define L3MDEV_UNICAST_PREF 1000 +#define VRF_FALLBACK_DISABLE_PREF 1001 +#define TABLE_LOCAL_PREF 1002 // after l3mdev-table using namespace swss; @@ -98,7 +100,9 @@ VrfMgr::VrfMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, con cmd.str(""); cmd.clear(); cmd << IP_CMD << " rule add pref " << TABLE_LOCAL_PREF << " table local && " << IP_CMD << " rule del pref 0 && " - << IP_CMD << " -6 rule add pref " << TABLE_LOCAL_PREF << " table local && " << IP_CMD << " -6 rule del pref 0"; + << IP_CMD << " -6 rule add pref " << TABLE_LOCAL_PREF << " table local && " << IP_CMD << " -6 rule del pref 0 && " + << IP_CMD << " rule add pref " << VRF_FALLBACK_DISABLE_PREF << " l3mdev unreachable && " + << IP_CMD << " -6 rule add pref " << VRF_FALLBACK_DISABLE_PREF << " l3mdev unreachable"; EXEC_WITH_ERROR_THROW(cmd.str(), res); } }