summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_nht.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-09-24 21:51:18 +0200
committerDonald Sharp <sharpd@nvidia.com>2021-09-27 18:38:08 +0200
commited6cec97d7f2c5abbc5a2ef2f087a614c54ddcb1 (patch)
treee5804304819a41268360ca56509a8711be3ee09f /bgpd/bgp_nht.c
parentzebra: Being able to use the default route is a boolean not an int (diff)
downloadfrr-ed6cec97d7f2c5abbc5a2ef2f087a614c54ddcb1.tar.xz
frr-ed6cec97d7f2c5abbc5a2ef2f087a614c54ddcb1.zip
*: Add resolve via default flag
Diffstat (limited to 'bgpd/bgp_nht.c')
-rw-r--r--bgpd/bgp_nht.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c
index c77e24085..87d76489b 100644
--- a/bgpd/bgp_nht.c
+++ b/bgpd/bgp_nht.c
@@ -843,6 +843,7 @@ static int make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p)
static void sendmsg_zebra_rnh(struct bgp_nexthop_cache *bnc, int command)
{
bool exact_match = false;
+ bool resolve_via_default = false;
int ret;
if (!zclient)
@@ -863,11 +864,12 @@ static void sendmsg_zebra_rnh(struct bgp_nexthop_cache *bnc, int command)
"%s: We have not connected yet, cannot send nexthops",
__func__);
}
- if ((command == ZEBRA_NEXTHOP_REGISTER
- || command == ZEBRA_IMPORT_ROUTE_REGISTER)
- && (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_CONNECTED)
- || CHECK_FLAG(bnc->flags, BGP_STATIC_ROUTE_EXACT_MATCH)))
- exact_match = true;
+ if (command == ZEBRA_NEXTHOP_REGISTER) {
+ if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_CONNECTED))
+ exact_match = true;
+ if (CHECK_FLAG(bnc->flags, BGP_STATIC_ROUTE_EXACT_MATCH))
+ resolve_via_default = true;
+ }
if (BGP_DEBUG(zebra, ZEBRA))
zlog_debug("%s: sending cmd %s for %pFX (vrf %s)", __func__,
@@ -875,7 +877,7 @@ static void sendmsg_zebra_rnh(struct bgp_nexthop_cache *bnc, int command)
bnc->bgp->name_pretty);
ret = zclient_send_rnh(zclient, command, &bnc->prefix, exact_match,
- bnc->bgp->vrf_id);
+ resolve_via_default, bnc->bgp->vrf_id);
/* TBD: handle the failure */
if (ret == ZCLIENT_SEND_FAILURE)
flog_warn(EC_BGP_ZEBRA_SEND,