diff options
author | Chris Hall <chris.hall@highwayman.com> | 2010-12-21 11:47:55 +0000 |
---|---|---|
committer | Chris Hall <chris.hall@highwayman.com> | 2010-12-21 11:47:55 +0000 |
commit | 5cffb8de373bbd19c9db36239cf41951e266953e (patch) | |
tree | 42318e7979acc96376cd1c4fe8ffd3dbcdd413ce /bgpd/bgp_vty.c | |
parent | d475a0f198f880595eb27e44008e5de3aad25d73 (diff) | |
download | quagga-ex09.tar.bz2 quagga-ex09.tar.xz |
ex09: Fix "no ip community-list"ex09
"no ip community-list" leaves a named list with NULL value, and
some operations did not check for that NULL value.
Diffstat (limited to 'bgpd/bgp_vty.c')
-rw-r--r-- | bgpd/bgp_vty.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 222e4485..25287a85 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -10367,6 +10367,7 @@ DEFUN (show_ip_community_list, vector extract ; vector_index i ; struct symbol* sym ; + struct community_list *list; table = community_list_master_lookup (bgp_clist, COMMUNITY_LIST_MASTER); if (table == NULL) @@ -10375,7 +10376,11 @@ DEFUN (show_ip_community_list, extract = symbol_table_extract(table, NULL, NULL, 0, symbol_mixed_name_cmp) ; for (VECTOR_ITEMS(extract, sym, i)) - community_list_show (vty, symbol_get_value(sym)); + { + list = symbol_get_value(sym) ; + if (list != NULL) + community_list_show (vty, list); + } ; vector_free(extract) ; /* discard temporary vector */ @@ -10721,6 +10726,7 @@ DEFUN (show_ip_extcommunity_list, vector extract ; vector_index i ; struct symbol* sym ; + struct community_list *list; table = community_list_master_lookup (bgp_clist, EXTCOMMUNITY_LIST_MASTER); if (table == NULL) @@ -10729,7 +10735,11 @@ DEFUN (show_ip_extcommunity_list, extract = symbol_table_extract(table, NULL, NULL, 0, symbol_mixed_name_cmp) ; for (VECTOR_ITEMS(extract, sym, i)) - extcommunity_list_show (vty, symbol_get_value(sym)); + { + list = symbol_get_value(sym) ; + if (list != NULL) + extcommunity_list_show (vty, list); + } ; vector_free(extract) ; /* discard temporary vector */ @@ -10796,6 +10806,10 @@ community_list_config_write_list(struct vty* vty, int what) for (VECTOR_ITEMS(extract, sym, i)) { list = symbol_get_value(sym) ; + + if (list == NULL) + continue ; + for (entry = list->head; entry; entry = entry->next) { const char* list_type = "" ; |