diff options
Diffstat (limited to 'bgpd')
| -rw-r--r-- | bgpd/bgp_nht.c | 8 | ||||
| -rw-r--r-- | bgpd/bgp_routemap.c | 10 |
2 files changed, 16 insertions, 2 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index bbc30365c7..733dcc72a2 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -316,6 +316,14 @@ int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop, if (make_prefix(afi, pi, &p) < 0) return 1; + /* + * If path is learnt from an interface based peer, + * set the ifindex to peer's interface index so that + * correct nexthop can be found in nexthop tree. + */ + if (pi->peer->conf_if) + ifindex = pi->peer->su.sin6.sin6_scope_id; + if (!is_bgp_static_route && orig_prefix && prefix_same(&p, orig_prefix)) { if (BGP_DEBUG(nht, NHT)) { diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 1c99495e6c..af9490f0b3 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -6163,6 +6163,7 @@ DEFPY_YANG( char xpath_value[XPATH_MAXLEN]; as_t as_configured_value; char replace_value[ASN_STRING_MAX_SIZE * 2]; + int ret; if (configured_asn_str && !asn_str2asn(configured_asn_str, &as_configured_value)) { @@ -6181,7 +6182,9 @@ DEFPY_YANG( "%s/rmap-set-action/frr-bgp-route-map:replace-as-path", xpath); nb_cli_enqueue_change(vty, xpath_value, NB_OP_MODIFY, str); - return nb_cli_apply_changes(vty, NULL); + ret = nb_cli_apply_changes(vty, NULL); + XFREE(MTYPE_TMP, str); + return ret; } DEFPY_YANG( @@ -6323,6 +6326,7 @@ DEFPY_YANG(set_aspath_exclude_access_list, set_aspath_exclude_access_list_cmd, const char *xpath = "./set-action[action='frr-bgp-route-map:as-path-exclude']"; char xpath_value[XPATH_MAXLEN]; + int ret; str = argv_concat(argv, argc, 3); @@ -6332,7 +6336,9 @@ DEFPY_YANG(set_aspath_exclude_access_list, set_aspath_exclude_access_list_cmd, "%s/rmap-set-action/frr-bgp-route-map:exclude-as-path", xpath); nb_cli_enqueue_change(vty, xpath_value, NB_OP_MODIFY, str); - return nb_cli_apply_changes(vty, NULL); + ret = nb_cli_apply_changes(vty, NULL); + XFREE(MTYPE_TMP, str); + return ret; } DEFPY_YANG(no_set_aspath_exclude_access_list, no_set_aspath_exclude_access_list_cmd, |
