diff options
author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-01-11 14:18:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-11 14:18:18 +0100 |
commit | b96138fbf04e6fa6e9c0ec4be011636b765b2e54 (patch) | |
tree | 5a7cf2afaa708b44e37f9eb5e3f78abc36320b79 | |
parent | Merge pull request #7845 from cgoncalves/fix-broken-links (diff) | |
parent | bgpd: fix removal of rd vpn export (diff) | |
download | frr-b96138fbf04e6fa6e9c0ec4be011636b765b2e54.tar.xz frr-b96138fbf04e6fa6e9c0ec4be011636b765b2e54.zip |
Merge pull request #7830 from volta-networks/misc_fixes_2021
Misc fixes (bgpd, pathd, tools)
-rw-r--r-- | bgpd/bgp_nb_config.c | 16 | ||||
-rw-r--r-- | pathd/path_pcep_cli.c | 3 | ||||
-rwxr-xr-x | tools/frr-reload.py | 53 |
3 files changed, 39 insertions, 33 deletions
diff --git a/bgpd/bgp_nb_config.c b/bgpd/bgp_nb_config.c index bee963329..f6a138ba4 100644 --- a/bgpd/bgp_nb_config.c +++ b/bgpd/bgp_nb_config.c @@ -894,6 +894,9 @@ int bgp_global_route_selection_options_allow_multiple_as_modify( "../multi-path-as-set")) { SET_FLAG(bgp->flags, BGP_FLAG_MULTIPATH_RELAX_AS_SET); + } else { + UNSET_FLAG(bgp->flags, + BGP_FLAG_MULTIPATH_RELAX_AS_SET); } } else { UNSET_FLAG(bgp->flags, BGP_FLAG_ASPATH_MULTIPATH_RELAX); @@ -923,15 +926,10 @@ int bgp_global_route_selection_options_multi_path_as_set_modify( return NB_OK; case NB_EV_APPLY: bgp = nb_running_get_entry(args->dnode, NULL, true); - - if (!CHECK_FLAG(bgp->flags, BGP_FLAG_MULTIPATH_RELAX_AS_SET)) { + if (yang_dnode_get_bool(args->dnode, NULL)) SET_FLAG(bgp->flags, BGP_FLAG_MULTIPATH_RELAX_AS_SET); - - } else - zlog_debug( - "%s multi-path-as-set as part of allow-multiple-as modify cb.", - __func__); - + else + UNSET_FLAG(bgp->flags, BGP_FLAG_MULTIPATH_RELAX_AS_SET); break; } @@ -9556,7 +9554,7 @@ static int bgp_global_afi_safi_ip_unicast_vpn_config_rd_destroy( bgp = nb_running_get_entry(af_dnode, NULL, true); rd_str = yang_dnode_get_string(args->dnode, NULL); - if (str2prefix_rd(rd_str, &prd)) { + if (!str2prefix_rd(rd_str, &prd)) { snprintf(args->errmsg, args->errmsg_len, "Malformed rd %s \n", rd_str); return NB_ERR_INCONSISTENCY; diff --git a/pathd/path_pcep_cli.c b/pathd/path_pcep_cli.c index 897395831..add3391f2 100644 --- a/pathd/path_pcep_cli.c +++ b/pathd/path_pcep_cli.c @@ -1482,7 +1482,8 @@ int pcep_cli_pcc_config_write(struct vty *vty) csnprintfrr(buf, sizeof(buf), " peer %s", pce_opts->pce_name); - if (pce_opts->precedence > 0) { + if (pce_opts->precedence > 0 + && pce_opts->precedence != DEFAULT_PCE_PRECEDENCE) { csnprintfrr(buf, sizeof(buf), " %s %d", PCEP_VTYSH_ARG_PRECEDENCE, pce_opts->precedence); diff --git a/tools/frr-reload.py b/tools/frr-reload.py index c18a314a0..d5fa8ab6a 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -684,26 +684,6 @@ end log.debug("LINE %-50s: entering new context, %-50s", line, ctx_keys) elif ( - line.startswith("peer ") - and len(ctx_keys) == 4 - and ctx_keys[0].startswith("segment-routing") - and ctx_keys[1].startswith("traffic-eng") - and ctx_keys[2].startswith("pcep") - and ctx_keys[3].startswith("pcc") - ): - # If there is no precedence, we add the default one (255) so - # the line is not removed and added back - m = re.search('peer ([^ ]*)', line) - if (m != None): - (name,) = m.groups() - line = "peer %s precedence 255" % (name,) - - current_context_lines.append(line) - log.debug( - "LINE %-50s: append to current_context_lines, %-50s", line, ctx_keys - ) - - elif ( line.startswith("address-family ") or line.startswith("vnc defaults") or line.startswith("vnc l2-group") @@ -1413,6 +1393,8 @@ def compare_context_objects(newconf, running): lines_to_del = [] pollist_to_del = [] seglist_to_del = [] + pceconf_to_del = [] + pcclist_to_del = [] candidates_to_add = [] delete_bgpd = False @@ -1498,9 +1480,8 @@ def compare_context_objects(newconf, running): # Segment routing and traffic engineering never need to be deleted elif ( - len(running_ctx_keys) > 1 + running_ctx_keys[0].startswith('segment-routing') and len(running_ctx_keys) < 3 - and running_ctx_keys[0].startswith('segment-routing') ): continue @@ -1508,7 +1489,7 @@ def compare_context_objects(newconf, running): elif ( len(running_ctx_keys) == 3 and running_ctx_keys[0].startswith('segment-routing') - and running_ctx_keys[2].startswith('pcep4') + and running_ctx_keys[2].startswith('pcep') ): continue @@ -1530,6 +1511,23 @@ def compare_context_objects(newconf, running): ): pollist_to_del.append((running_ctx_keys, None)) + # pce-config must be deleted after the pce, to be sure we add them + # to a separate array that is going to be appended at the end + elif ( + len(running_ctx_keys) >= 4 + and running_ctx_keys[0].startswith('segment-routing') + and running_ctx_keys[3].startswith('pce-config') + ): + pceconf_to_del.append((running_ctx_keys, None)) + + # pcc must be deleted after the pce and pce-config too + elif ( + len(running_ctx_keys) >= 4 + and running_ctx_keys[0].startswith('segment-routing') + and running_ctx_keys[3].startswith('pcc') + ): + pcclist_to_del.append((running_ctx_keys, None)) + # Non-global context elif running_ctx_keys and not any( "address-family" in key for key in running_ctx_keys @@ -1552,6 +1550,14 @@ def compare_context_objects(newconf, running): if len(seglist_to_del) > 0: lines_to_del.extend(seglist_to_del) + # if we have some pce list commands to delete, append them to lines_to_del + if len(pceconf_to_del) > 0: + lines_to_del.extend(pceconf_to_del) + + # if we have some pcc list commands to delete, append them to lines_to_del + if len(pcclist_to_del) > 0: + lines_to_del.extend(pcclist_to_del) + # Find the lines within each context to add # Find the lines within each context to del for (newconf_ctx_keys, newconf_ctx) in iteritems(newconf.contexts): @@ -1765,6 +1771,7 @@ if __name__ == "__main__": "vrrpd", "ldpd", "pathd", + "bfdd", ]: msg = "Daemon %s is not a valid option for 'show running-config'" % args.daemon print(msg) |