From 6f593e8003c043c09d1c3a15cf0f64768a3d8906 Mon Sep 17 00:00:00 2001 From: Don Slice Date: Wed, 22 Nov 2017 16:25:44 +0000 Subject: [PATCH] zebra: slight mods to commit for nexthop resolution with /32 nexthop Contains minor changes in response to code review comments. Signed-off-by: Don Slice --- zebra/zebra_rnh.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index 4ff4fa7033..33d0b3a641 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -376,7 +376,6 @@ static int zebra_rnh_apply_nht_rmap(int family, struct route_node *prn, static struct route_entry *zebra_rnh_resolve_import_entry(vrf_id_t vrfid, int family, - rnh_type_t type, struct route_node *nrn, struct rnh *rnh, struct route_node **prn) @@ -398,12 +397,8 @@ struct route_entry *zebra_rnh_resolve_import_entry(vrf_id_t vrfid, /* Unlock route node - we don't need to lock when walking the tree. */ route_unlock_node(rn); - /* When resolving nexthops, do not resolve via the default route unless - * 'ip nht resolve-via-default' is configured. - */ - if (((is_default_prefix(&rn->p)) || - ((CHECK_FLAG(rnh->flags, ZEBRA_NHT_EXACT_MATCH)) && - !prefix_same(&nrn->p, &rn->p)))) + if (CHECK_FLAG(rnh->flags, ZEBRA_NHT_EXACT_MATCH) && + !prefix_same(&nrn->p, &rn->p)) return NULL; /* Identify appropriate route entry. */ @@ -784,7 +779,7 @@ static void zebra_rnh_evaluate_entry(vrf_id_t vrfid, int family, int force, /* Identify route entry (RE) resolving this tracked entry. */ if (type == RNH_IMPORT_CHECK_TYPE) - re = zebra_rnh_resolve_import_entry(vrfid, family, type, nrn, + re = zebra_rnh_resolve_import_entry(vrfid, family, nrn, rnh, &prn); else re = zebra_rnh_resolve_nexthop_entry(vrfid, family, nrn, rnh, @@ -825,7 +820,7 @@ static void zebra_rnh_clear_nhc_flag(vrf_id_t vrfid, int family, /* Identify route entry (RIB) resolving this tracked entry. */ if (type == RNH_IMPORT_CHECK_TYPE) - re = zebra_rnh_resolve_import_entry(vrfid, family, type, nrn, + re = zebra_rnh_resolve_import_entry(vrfid, family, nrn, rnh, &prn); else re = zebra_rnh_resolve_nexthop_entry(vrfid, family, nrn, rnh,