summaryrefslogtreecommitdiff
path: root/bgpd/bgp_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_zebra.c')
-rw-r--r--bgpd/bgp_zebra.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 24652ee93a..fa290743c7 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -3316,6 +3316,13 @@ void bgp_zebra_announce_default(struct bgp *bgp, struct nexthop *nh,
&& nh->type != NEXTHOP_TYPE_IPV6)
|| nh->vrf_id == VRF_UNKNOWN)
return;
+
+ /* in vrf-lite, no default route has to be announced
+ * the table id of vrf is directly used to divert traffic
+ */
+ if (!vrf_is_backend_netns() && bgp->vrf_id != nh->vrf_id)
+ return;
+
memset(&p, 0, sizeof(struct prefix));
if (afi != AFI_IP && afi != AFI_IP6)
return;