diff options
| -rw-r--r-- | bgpd/bgp_attr.c | 2 | ||||
| -rw-r--r-- | bgpd/bgp_updgrp_packet.c | 16 | ||||
| -rw-r--r-- | bgpd/rfapi/bgp_rfapi_cfg.c | 33 | ||||
| -rw-r--r-- | bgpd/rfapi/bgp_rfapi_cfg.h | 4 | ||||
| -rw-r--r-- | bgpd/rfapi/rfapi.c | 8 | ||||
| -rw-r--r-- | bgpd/rfapi/rfapi_import.c | 13 | ||||
| -rw-r--r-- | bgpd/rfapi/rfapi_private.h | 2 | ||||
| -rw-r--r-- | lib/hash.c | 21 | ||||
| -rw-r--r-- | lib/hash.h | 3 | ||||
| -rw-r--r-- | zebra/debug.c | 123 | ||||
| -rw-r--r-- | zebra/zebra_vty.c | 118 |
11 files changed, 166 insertions, 177 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index 79d215f1bd..ef32b9cf92 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -2039,7 +2039,7 @@ static int bgp_attr_encap(uint8_t type, struct peer *peer, /* IN */ } #endif } - stlv_last->next = tlv; + stlv_last = tlv; } if (BGP_ATTR_ENCAP == type) { diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c index d7a4a36986..1a23a36e91 100644 --- a/bgpd/bgp_updgrp_packet.c +++ b/bgpd/bgp_updgrp_packet.c @@ -700,6 +700,7 @@ struct bpacket *subgroup_update_packet(struct update_subgroup *subgrp) int send_attr_printed = 0; int num_pfx = 0; int addpath_encode = 0; + int addpath_overhead = 0; u_int32_t addpath_tx_id = 0; struct prefix_rd *prd = NULL; mpls_label_t label = MPLS_INVALID_LABEL; @@ -721,6 +722,7 @@ struct bpacket *subgroup_update_packet(struct update_subgroup *subgrp) bpacket_attr_vec_arr_reset(&vecarr); addpath_encode = bgp_addpath_encode_tx(peer, afi, safi); + addpath_overhead = addpath_encode ? BGP_ADDPATH_ID_LEN : 0; adv = BGP_ADV_FIFO_HEAD(&subgrp->sync->update); while (adv) { @@ -732,8 +734,8 @@ struct bpacket *subgroup_update_packet(struct update_subgroup *subgrp) space_remaining = STREAM_CONCAT_REMAIN(s, snlri, STREAM_SIZE(s)) - BGP_MAX_PACKET_SIZE_OVERFLOW; - space_needed = BGP_NLRI_LENGTH + bgp_packet_mpattr_prefix_size( - afi, safi, &rn->p); + space_needed = BGP_NLRI_LENGTH + addpath_overhead + + bgp_packet_mpattr_prefix_size(afi, safi, &rn->p); /* When remaining space can't include NLRI and it's length. */ if (space_remaining < space_needed) @@ -777,9 +779,9 @@ struct bpacket *subgroup_update_packet(struct update_subgroup *subgrp) space_remaining = STREAM_CONCAT_REMAIN(s, snlri, STREAM_SIZE(s)) - BGP_MAX_PACKET_SIZE_OVERFLOW; - space_needed = - BGP_NLRI_LENGTH + bgp_packet_mpattr_prefix_size( - afi, safi, &rn->p); + space_needed = BGP_NLRI_LENGTH + addpath_overhead + + bgp_packet_mpattr_prefix_size(afi, safi, + &rn->p); /* If the attributes alone do not leave any room for * NLRI then @@ -936,6 +938,7 @@ struct bpacket *subgroup_withdraw_packet(struct update_subgroup *subgrp) int space_needed = 0; int num_pfx = 0; int addpath_encode = 0; + int addpath_overhead = 0; u_int32_t addpath_tx_id = 0; struct prefix_rd *prd = NULL; @@ -952,6 +955,7 @@ struct bpacket *subgroup_withdraw_packet(struct update_subgroup *subgrp) s = subgrp->work; stream_reset(s); addpath_encode = bgp_addpath_encode_tx(peer, afi, safi); + addpath_overhead = addpath_encode ? BGP_ADDPATH_ID_LEN : 0; while ((adv = BGP_ADV_FIFO_HEAD(&subgrp->sync->withdraw)) != NULL) { assert(adv->rn); @@ -962,7 +966,7 @@ struct bpacket *subgroup_withdraw_packet(struct update_subgroup *subgrp) space_remaining = STREAM_REMAIN(s) - BGP_MAX_PACKET_SIZE_OVERFLOW; space_needed = - BGP_NLRI_LENGTH + BGP_TOTAL_ATTR_LEN + BGP_NLRI_LENGTH + addpath_overhead + BGP_TOTAL_ATTR_LEN + bgp_packet_mpattr_prefix_size(afi, safi, &rn->p); if (space_remaining < space_needed) diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c index 8a93d3984e..c8e2dd9525 100644 --- a/bgpd/rfapi/bgp_rfapi_cfg.c +++ b/bgpd/rfapi/bgp_rfapi_cfg.c @@ -135,10 +135,10 @@ struct rfapi_nve_group_cfg *bgp_rfapi_cfg_match_group(struct rfapi_cfg *hc, switch (vn->family) { case AF_INET: - rt_vn = &(hc->nve_groups_vn[AFI_IP]); + rt_vn = hc->nve_groups_vn[AFI_IP]; break; case AF_INET6: - rt_vn = &(hc->nve_groups_vn[AFI_IP6]); + rt_vn = hc->nve_groups_vn[AFI_IP6]; break; default: return NULL; @@ -146,10 +146,10 @@ struct rfapi_nve_group_cfg *bgp_rfapi_cfg_match_group(struct rfapi_cfg *hc, switch (un->family) { case AF_INET: - rt_un = &(hc->nve_groups_un[AFI_IP]); + rt_un = hc->nve_groups_un[AFI_IP]; break; case AF_INET6: - rt_un = &(hc->nve_groups_un[AFI_IP6]); + rt_un = hc->nve_groups_un[AFI_IP6]; break; default: return NULL; @@ -2503,7 +2503,7 @@ DEFUN (vnc_nve_group_prefix, VTY_DECLVAR_CONTEXT(bgp, bgp); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg); struct prefix p; - int afi; + afi_t afi; struct route_table *rt; struct route_node *rn; int is_un_prefix = 0; @@ -2527,10 +2527,10 @@ DEFUN (vnc_nve_group_prefix, } if (argv[1]->arg[0] == 'u') { - rt = &(bgp->rfapi_cfg->nve_groups_un[afi]); + rt = bgp->rfapi_cfg->nve_groups_un[afi]; is_un_prefix = 1; } else { - rt = &(bgp->rfapi_cfg->nve_groups_vn[afi]); + rt = bgp->rfapi_cfg->nve_groups_vn[afi]; } rn = route_node_get(rt, &p); /* NB locks node */ @@ -3830,7 +3830,7 @@ void bgp_rfapi_cfg_init(void) struct rfapi_cfg *bgp_rfapi_cfg_new(struct rfapi_rfp_cfg *cfg) { struct rfapi_cfg *h; - int afi; + afi_t afi; h = (struct rfapi_cfg *)XCALLOC(MTYPE_RFAPI_CFG, sizeof(struct rfapi_cfg)); @@ -3838,14 +3838,9 @@ struct rfapi_cfg *bgp_rfapi_cfg_new(struct rfapi_rfp_cfg *cfg) h->nve_groups_sequential = list_new(); assert(h->nve_groups_sequential); - for (afi = AFI_IP; afi < AFI_MAX; afi++) { - /* ugly, to deal with addition of delegates, part of 0.99.24.1 - * merge */ - h->nve_groups_vn[afi].delegate = - route_table_get_default_delegate(); - h->nve_groups_un[afi].delegate = - route_table_get_default_delegate(); + h->nve_groups_vn[afi] = route_table_init(); + h->nve_groups_un[afi] = route_table_init(); } h->default_response_lifetime = BGP_VNC_DEFAULT_RESPONSE_LIFETIME_DEFAULT; @@ -3885,6 +3880,7 @@ struct rfapi_cfg *bgp_rfapi_cfg_new(struct rfapi_rfp_cfg *cfg) void bgp_rfapi_cfg_destroy(struct bgp *bgp, struct rfapi_cfg *h) { + afi_t afi; if (h == NULL) return; @@ -3901,6 +3897,10 @@ void bgp_rfapi_cfg_destroy(struct bgp *bgp, struct rfapi_cfg *h) ecommunity_free(&h->default_rt_import_list); if (h->default_rfp_cfg) XFREE(MTYPE_RFAPI_RFP_GROUP_CFG, h->default_rfp_cfg); + for (afi = AFI_IP; afi < AFI_MAX; afi++) { + route_table_finish(h->nve_groups_vn[afi]); + route_table_finish(h->nve_groups_un[afi]); + } XFREE(MTYPE_RFAPI_CFG, h); } @@ -4571,7 +4571,8 @@ int bgp_rfapi_cfg_write(struct vty *vty, struct bgp *bgp) void bgp_rfapi_show_summary(struct bgp *bgp, struct vty *vty) { struct rfapi_cfg *hc = bgp->rfapi_cfg; - int afi, type, redist = 0; + afi_t afi; + int type, redist = 0; char tmp[40]; if (hc == NULL) return; diff --git a/bgpd/rfapi/bgp_rfapi_cfg.h b/bgpd/rfapi/bgp_rfapi_cfg.h index d99aefa60d..a11b0992fa 100644 --- a/bgpd/rfapi/bgp_rfapi_cfg.h +++ b/bgpd/rfapi/bgp_rfapi_cfg.h @@ -135,8 +135,8 @@ struct rfapi_cfg { struct list *l2_groups; /* rfapi_l2_group_cfg list */ /* three views into the same collection of rfapi_nve_group_cfg */ struct list *nve_groups_sequential; - struct route_table nve_groups_vn[AFI_MAX]; - struct route_table nve_groups_un[AFI_MAX]; + struct route_table *nve_groups_vn[AFI_MAX]; + struct route_table *nve_groups_un[AFI_MAX]; /* * For Single VRF export to ordinary routing protocols. This is diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index 3a2a608a7c..ab71eda126 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -205,7 +205,7 @@ static int rfapi_find_node(struct bgp *bgp, struct rfapi_ip_addr *vn_addr, struct prefix p; struct route_node *rn; int rc; - int afi; + afi_t afi; if (!bgp) { return ENXIO; @@ -224,7 +224,7 @@ static int rfapi_find_node(struct bgp *bgp, struct rfapi_ip_addr *vn_addr, if ((rc = rfapiRaddr2Qprefix(un_addr, &p))) return rc; - rn = route_node_lookup(&h->un[afi], &p); + rn = route_node_lookup(h->un[afi], &p); if (!rn) return ENOENT; @@ -1415,7 +1415,7 @@ int rfapi_init_and_open(struct bgp *bgp, struct rfapi_descriptor *rfd, assert(afi_vn && afi_un); assert(!rfapiRaddr2Qprefix(&rfd->un_addr, &pfx_un)); - rn = route_node_get(&(h->un[afi_un]), &pfx_un); + rn = route_node_get(h->un[afi_un], &pfx_un); assert(rn); rfd->next = rn->info; rn->info = rfd; @@ -2367,7 +2367,7 @@ int rfapi_register(void *handle, struct rfapi_ip_prefix *prefix, struct prefix p; struct prefix *pfx_ip = NULL; struct prefix_rd prd; - int afi; + afi_t afi; struct prefix pfx_mac_buf; struct prefix *pfx_mac = NULL; struct prefix pfx_vn_buf; diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index d0379e1ef8..0bbbe12cce 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -4248,7 +4248,7 @@ static void rfapiBgpTableFilteredImport(struct bgp *bgp, struct rfapi *bgp_rfapi_new(struct bgp *bgp) { struct rfapi *h; - int afi; + afi_t afi; struct rfapi_rfp_cfg *cfg = NULL; struct rfapi_rfp_cb_methods *cbm = NULL; @@ -4257,9 +4257,7 @@ struct rfapi *bgp_rfapi_new(struct bgp *bgp) h = (struct rfapi *)XCALLOC(MTYPE_RFAPI, sizeof(struct rfapi)); for (afi = AFI_IP; afi < AFI_MAX; afi++) { - /* ugly, to deal with addition of delegates, part of 0.99.24.1 - * merge */ - h->un[afi].delegate = route_table_get_default_delegate(); + h->un[afi] = route_table_init(); } /* @@ -4292,6 +4290,8 @@ struct rfapi *bgp_rfapi_new(struct bgp *bgp) void bgp_rfapi_destroy(struct bgp *bgp, struct rfapi *h) { + afi_t afi; + if (bgp == NULL || h == NULL) return; @@ -4327,6 +4327,11 @@ void bgp_rfapi_destroy(struct bgp *bgp, struct rfapi *h) if (h->rfp != NULL) rfp_stop(h->rfp); + + for (afi = AFI_IP; afi < AFI_MAX; afi++) { + route_table_finish(h->un[afi]); + } + XFREE(MTYPE_RFAPI_IMPORTTABLE, h->it_ce); XFREE(MTYPE_RFAPI, h); } diff --git a/bgpd/rfapi/rfapi_private.h b/bgpd/rfapi/rfapi_private.h index e7a3e5aae3..73c9312a64 100644 --- a/bgpd/rfapi/rfapi_private.h +++ b/bgpd/rfapi/rfapi_private.h @@ -171,7 +171,7 @@ struct rfapi_global_stats { * check vn address to get exact match. */ struct rfapi { - struct route_table un[AFI_MAX]; + struct route_table *un[AFI_MAX]; struct rfapi_import_table *imports; /* IPv4, IPv6 */ struct list descriptors; /* debug & resolve-nve imports */ diff --git a/lib/hash.c b/lib/hash.c index 7adbd908d8..a7714f1569 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -49,7 +49,6 @@ struct hash *hash_create_size(unsigned int size, hash->index = XCALLOC(MTYPE_HASH_INDEX, sizeof(struct hash_backet *) * size); hash->size = size; - hash->no_expand = 0; hash->hash_key = hash_key; hash->hash_cmp = hash_cmp; hash->count = 0; @@ -91,7 +90,7 @@ void *hash_alloc_intern(void *arg) /* Expand hash if the chain length exceeds the threshold. */ static void hash_expand(struct hash *hash) { - unsigned int i, new_size, losers; + unsigned int i, new_size; struct hash_backet *hb, *hbnext, **new_index; new_size = hash->size * 2; @@ -128,22 +127,6 @@ static void hash_expand(struct hash *hash) XFREE(MTYPE_HASH_INDEX, hash->index); hash->size = new_size; hash->index = new_index; - - /* Ideally, new index should have chains half as long as the original. - * If expansion didn't help, then not worth expanding again, - * the problem is the hash function. */ - losers = 0; - for (i = 0; i < hash->size; i++) { - unsigned int len = hash->index[i] ? hash->index[i]->len : 0; - - if (len > HASH_THRESHOLD / 2) - ++losers; - if (len >= HASH_THRESHOLD) - hash->no_expand = 1; - } - - if (losers > hash->count / 2) - hash->no_expand = 1; } /* Lookup and return hash backet in hash. If there is no @@ -173,7 +156,7 @@ void *hash_get(struct hash *hash, void *data, void *(*alloc_func)(void *)) if (newdata == NULL) return NULL; - if (len > HASH_THRESHOLD && !hash->no_expand) { + if (len > HASH_THRESHOLD) { hash_expand(hash); index = key & (hash->size - 1); } diff --git a/lib/hash.h b/lib/hash.h index ec3766eaaa..6ce29f0426 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -64,9 +64,6 @@ struct hash { /* Hash table size. Must be power of 2 */ unsigned int size; - /* If expansion failed. */ - int no_expand; - /* Key make function. */ unsigned int (*hash_key)(void *); diff --git a/zebra/debug.c b/zebra/debug.c index fc2cd44e5f..6aedea1e39 100644 --- a/zebra/debug.c +++ b/zebra/debug.c @@ -71,10 +71,10 @@ DEFUN (show_debugging_zebra, " Zebra kernel netlink message dumps (recv) are on\n"); /* Check here using flags as the 'macro' does an OR */ - if (CHECK_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB)) - vty_out(vty, " Zebra RIB debugging is on\n"); if (CHECK_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB_DETAILED)) vty_out(vty, " Zebra RIB detailed debugging is on\n"); + else if (CHECK_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB)) + vty_out(vty, " Zebra RIB debugging is on\n"); if (IS_ZEBRA_DEBUG_FPM) vty_out(vty, " Zebra FPM debugging is on\n"); @@ -154,6 +154,7 @@ DEFUN (debug_zebra_packet, if (argv_find(argv, argc, "detail", &idx)) SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_DETAIL); + return CMD_SUCCESS; } @@ -165,6 +166,13 @@ DEFUN (debug_zebra_kernel, "Debug option set for zebra between kernel interface\n") { SET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL); + + if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV) + UNSET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV); + + if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND) + UNSET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND); + return CMD_SUCCESS; } @@ -179,34 +187,41 @@ DEFUN (debug_zebra_kernel_msgdump, "Dump raw netlink messages sent\n") { int idx = 0; - if (argc == 4 || argv_find(argv, argc, "recv", &idx)) + + if (argv_find(argv, argc, "recv", &idx)) { + SET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV); + + if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND) + UNSET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND); + + } else if (argv_find(argv, argc, "send", &idx)) { + SET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND); + + if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV) + UNSET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV); + + } else { SET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV); - if (argc == 4 || argv_find(argv, argc, "send", &idx)) SET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND); + } return CMD_SUCCESS; } DEFUN (debug_zebra_rib, debug_zebra_rib_cmd, - "debug zebra rib", - DEBUG_STR - "Zebra configuration\n" - "Debug RIB events\n") -{ - SET_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB); - return CMD_SUCCESS; -} - -DEFUN (debug_zebra_rib_detailed, - debug_zebra_rib_detailed_cmd, - "debug zebra rib detailed", + "debug zebra rib [detailed]", DEBUG_STR "Zebra configuration\n" "Debug RIB events\n" "Detailed debugs\n") { - SET_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB_DETAILED); + int idx = 0; + SET_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB); + + if (argv_find(argv, argc, "detailed", &idx)) + SET_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB_DETAILED); + return CMD_SUCCESS; } @@ -271,19 +286,16 @@ DEFUN (no_debug_zebra_vxlan, DEFUN (no_debug_zebra_packet, no_debug_zebra_packet_cmd, - "no debug zebra packet [<recv|send>]", + "no debug zebra packet [<recv|send>] [detail]", NO_STR DEBUG_STR "Zebra configuration\n" "Debug option set for zebra packet\n" "Debug option set for receive packet\n" - "Debug option set for send packet\n") + "Debug option set for send packet\n" + "Debug option set for detailed info\n") { - int idx = 0; - if (argc == 4 || argv_find(argv, argc, "send", &idx)) - UNSET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND); - if (argc == 4 || argv_find(argv, argc, "recv", &idx)) - UNSET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV); + zebra_debug_packet = 0; return CMD_SUCCESS; } @@ -295,7 +307,7 @@ DEFUN (no_debug_zebra_kernel, "Zebra configuration\n" "Debug option set for zebra between kernel interface\n") { - UNSET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL); + zebra_debug_kernel = 0; return CMD_SUCCESS; } @@ -310,37 +322,20 @@ DEFUN (no_debug_zebra_kernel_msgdump, "Dump raw netlink messages received\n" "Dump raw netlink messages sent\n") { - int idx = 0; - if (argc == 5 || argv_find(argv, argc, "recv", &idx)) - UNSET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV); - if (argc == 5 || argv_find(argv, argc, "send", &idx)) - UNSET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND); - + zebra_debug_kernel = 0; return CMD_SUCCESS; } DEFUN (no_debug_zebra_rib, no_debug_zebra_rib_cmd, - "no debug zebra rib", - NO_STR - DEBUG_STR - "Zebra configuration\n" - "Debug zebra RIB\n") -{ - zebra_debug_rib = 0; - return CMD_SUCCESS; -} - -DEFUN (no_debug_zebra_rib_detailed, - no_debug_zebra_rib_detailed_cmd, - "no debug zebra rib detailed", + "no debug zebra rib [detailed]", NO_STR DEBUG_STR "Zebra configuration\n" "Debug zebra RIB\n" "Detailed debugs\n") { - UNSET_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB_DETAILED); + zebra_debug_rib = 0; return CMD_SUCCESS; } @@ -383,27 +378,31 @@ static int config_write_debug(struct vty *vty) write++; } } + if (IS_ZEBRA_DEBUG_KERNEL) { - vty_out(vty, "debug zebra kernel\n"); - write++; - } - if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV) { - vty_out(vty, "debug zebra kernel msgdump recv\n"); - write++; - } - if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND) { - vty_out(vty, "debug zebra kernel msgdump send\n"); - write++; - } - /* Check here using flags as the 'macro' does an OR */ - if (CHECK_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB)) { - vty_out(vty, "debug zebra rib\n"); - write++; + if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND && IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV) { + vty_out(vty, "debug zebra kernel msgdump\n"); + write++; + } else if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV) { + vty_out(vty, "debug zebra kernel msgdump recv\n"); + write++; + } else if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND) { + vty_out(vty, "debug zebra kernel msgdump send\n"); + write++; + } else { + vty_out(vty, "debug zebra kernel\n"); + write++; + } } + if (CHECK_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB_DETAILED)) { vty_out(vty, "debug zebra rib detailed\n"); write++; + } else if (CHECK_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB)) { + vty_out(vty, "debug zebra rib\n"); + write++; } + if (IS_ZEBRA_DEBUG_FPM) { vty_out(vty, "debug zebra fpm\n"); write++; @@ -445,7 +444,6 @@ void zebra_debug_init(void) install_element(ENABLE_NODE, &debug_zebra_kernel_cmd); install_element(ENABLE_NODE, &debug_zebra_kernel_msgdump_cmd); install_element(ENABLE_NODE, &debug_zebra_rib_cmd); - install_element(ENABLE_NODE, &debug_zebra_rib_detailed_cmd); install_element(ENABLE_NODE, &debug_zebra_fpm_cmd); install_element(ENABLE_NODE, &no_debug_zebra_events_cmd); install_element(ENABLE_NODE, &no_debug_zebra_nht_cmd); @@ -455,7 +453,6 @@ void zebra_debug_init(void) install_element(ENABLE_NODE, &no_debug_zebra_kernel_cmd); install_element(ENABLE_NODE, &no_debug_zebra_kernel_msgdump_cmd); install_element(ENABLE_NODE, &no_debug_zebra_rib_cmd); - install_element(ENABLE_NODE, &no_debug_zebra_rib_detailed_cmd); install_element(ENABLE_NODE, &no_debug_zebra_fpm_cmd); install_element(CONFIG_NODE, &debug_zebra_events_cmd); @@ -466,7 +463,6 @@ void zebra_debug_init(void) install_element(CONFIG_NODE, &debug_zebra_kernel_cmd); install_element(CONFIG_NODE, &debug_zebra_kernel_msgdump_cmd); install_element(CONFIG_NODE, &debug_zebra_rib_cmd); - install_element(CONFIG_NODE, &debug_zebra_rib_detailed_cmd); install_element(CONFIG_NODE, &debug_zebra_fpm_cmd); install_element(CONFIG_NODE, &no_debug_zebra_events_cmd); install_element(CONFIG_NODE, &no_debug_zebra_nht_cmd); @@ -476,6 +472,5 @@ void zebra_debug_init(void) install_element(CONFIG_NODE, &no_debug_zebra_kernel_cmd); install_element(CONFIG_NODE, &no_debug_zebra_kernel_msgdump_cmd); install_element(CONFIG_NODE, &no_debug_zebra_rib_cmd); - install_element(CONFIG_NODE, &no_debug_zebra_rib_detailed_cmd); install_element(CONFIG_NODE, &no_debug_zebra_fpm_cmd); } diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 3978664dbe..50fa69d224 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -444,20 +444,20 @@ DEFUN (ip_route_flags, } /* Mask as A.B.C.D format. */ -DEFUN (ip_route_mask, - ip_route_mask_cmd, - "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> [tag (1-4294967295)] [(1-255)] [vrf NAME]", - IP_STR - "Establish static routes\n" - "IP destination prefix\n" - "IP destination prefix mask\n" - "IP gateway address\n" - "IP gateway interface name\n" - "Null interface\n" - "Set tag for this route\n" - "Tag value\n" - "Distance value for this route\n" - VRF_CMD_HELP_STR) +DEFUN_HIDDEN (ip_route_mask, + ip_route_mask_cmd, + "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> [tag (1-4294967295)] [(1-255)] [vrf NAME]", + IP_STR + "Establish static routes\n" + "IP destination prefix\n" + "IP destination prefix mask\n" + "IP gateway address\n" + "IP gateway interface name\n" + "Null interface\n" + "Set tag for this route\n" + "Tag value\n" + "Distance value for this route\n" + VRF_CMD_HELP_STR) { int idx_ipv4 = 2; int idx_ipv4_2 = 3; @@ -475,19 +475,19 @@ DEFUN (ip_route_mask, distance, vrf, NULL); } -DEFUN (ip_route_mask_flags, - ip_route_mask_flags_cmd, - "ip route A.B.C.D A.B.C.D <reject|blackhole> [tag (1-4294967295)] [(1-255)] [vrf NAME]", - IP_STR - "Establish static routes\n" - "IP destination prefix\n" - "IP destination prefix mask\n" - "Emit an ICMP unreachable when matched\n" - "Silently discard pkts when matched\n" - "Set tag for this route\n" - "Tag value\n" - "Distance value for this route\n" - VRF_CMD_HELP_STR) +DEFUN_HIDDEN (ip_route_mask_flags, + ip_route_mask_flags_cmd, + "ip route A.B.C.D A.B.C.D <reject|blackhole> [tag (1-4294967295)] [(1-255)] [vrf NAME]", + IP_STR + "Establish static routes\n" + "IP destination prefix\n" + "IP destination prefix mask\n" + "Emit an ICMP unreachable when matched\n" + "Silently discard pkts when matched\n" + "Set tag for this route\n" + "Tag value\n" + "Distance value for this route\n" + VRF_CMD_HELP_STR) { int idx_ipv4 = 2; int idx_ipv4_2 = 3; @@ -562,21 +562,21 @@ DEFUN (no_ip_route_flags, NULL, tag, distance, vrf, NULL); } -DEFUN (no_ip_route_mask, - no_ip_route_mask_cmd, - "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> [tag (1-4294967295)] [(1-255)] [vrf NAME]", - NO_STR - IP_STR - "Establish static routes\n" - "IP destination prefix\n" - "IP destination prefix mask\n" - "IP gateway address\n" - "IP gateway interface name\n" - "Null interface\n" - "Tag of this route\n" - "Tag value\n" - "Distance value for this route\n" - VRF_CMD_HELP_STR) +DEFUN_HIDDEN (no_ip_route_mask, + no_ip_route_mask_cmd, + "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> [tag (1-4294967295)] [(1-255)] [vrf NAME]", + NO_STR + IP_STR + "Establish static routes\n" + "IP destination prefix\n" + "IP destination prefix mask\n" + "IP gateway address\n" + "IP gateway interface name\n" + "Null interface\n" + "Tag of this route\n" + "Tag value\n" + "Distance value for this route\n" + VRF_CMD_HELP_STR) { int idx_ipv4 = 3; int idx_ipv4_2 = 4; @@ -594,20 +594,20 @@ DEFUN (no_ip_route_mask, distance, vrf, NULL); } -DEFUN (no_ip_route_mask_flags, - no_ip_route_mask_flags_cmd, - "no ip route A.B.C.D A.B.C.D <reject|blackhole> [tag (1-4294967295)] [(1-255)] [vrf NAME]", - NO_STR - IP_STR - "Establish static routes\n" - "IP destination prefix\n" - "IP destination prefix mask\n" - "Emit an ICMP unreachable when matched\n" - "Silently discard pkts when matched\n" - "Tag of this route\n" - "Tag value\n" - "Distance value for this route\n" - VRF_CMD_HELP_STR) +DEFUN_HIDDEN (no_ip_route_mask_flags, + no_ip_route_mask_flags_cmd, + "no ip route A.B.C.D A.B.C.D <reject|blackhole> [tag (1-4294967295)] [(1-255)] [vrf NAME]", + NO_STR + IP_STR + "Establish static routes\n" + "IP destination prefix\n" + "IP destination prefix mask\n" + "Emit an ICMP unreachable when matched\n" + "Silently discard pkts when matched\n" + "Tag of this route\n" + "Tag value\n" + "Distance value for this route\n" + VRF_CMD_HELP_STR) { int idx_ipv4 = 3; int idx_ipv4_2 = 4; @@ -1937,8 +1937,12 @@ static int static_config(struct vty *vty, afi_t afi, safi_t safi, case STATIC_IFINDEX: vty_out(vty, " %s", si->ifname); break; + /* blackhole and Null0 mean the same thing */ case STATIC_BLACKHOLE: - vty_out(vty, " Null0"); + if (CHECK_FLAG(si->flags, ZEBRA_FLAG_REJECT)) + vty_out(vty, " reject"); + else + vty_out(vty, " Null0"); break; case STATIC_IPV6_GATEWAY_IFINDEX: vty_out(vty, " %s %s", |
