summaryrefslogtreecommitdiff
path: root/bgpd/bgp_zebra.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2021-03-26 10:48:38 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2021-08-01 14:38:13 +0200
commit7afeaffa1276b824a321b0f81c7b6780ff56f503 (patch)
tree9091edddbd725ab84823c9736fa8860a3f5ad914 /bgpd/bgp_zebra.c
parenta76301c11c10bc87ff14d954bab21bca8679fad9 (diff)
bgpd: flowspec redirect vrf uses vrf table instead of allocated table id
Until now, when bgp flowspec entry action was to redirect to a vrf, a default route was installed in a specific table. that route was a vrf route leak one. The process can be simplified, as vrf-lite already has a table identifier. Actually, because policy routing is used to redirect traffic to a defined table (with ip rule command), use the table identifier of the VRF. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
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;