diff options
-rw-r--r-- | README | 6 | ||||
-rw-r--r-- | bgpd/bgp_routemap.c | 47 | ||||
-rw-r--r-- | cumulus/start-stop-daemon.c | 2 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | lib/memory.c | 1 | ||||
-rw-r--r-- | lib/routemap.c | 12 | ||||
-rw-r--r-- | ospf6d/ospf6_asbr.c | 112 | ||||
-rw-r--r-- | pimd/pimd.c | 3 | ||||
-rw-r--r-- | tests/common-cli.c | 2 | ||||
-rw-r--r-- | zebra/zserv.c | 7 |
10 files changed, 40 insertions, 154 deletions
@@ -2,8 +2,12 @@ Free Range Routing is free software that manages various IPv4 and IPv6 routing protocols. Currently Free Range Routing supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, -RIPv2, RIPng, PIM-SSM and LDP as well as very early support for IS-IS. +RIPv2, RIPng, PIM-SM/MSDP and LDP as well as very early support for IS-IS. See the file REPORTING-BUGS to report bugs. Free Range Routing is free software. See the file COPYING for copying conditions. + +Public email discussion can be found at https://lists.nox.tf/listinfo/frr + +Our public slack channel is at https://freerangerouting.slack.com diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 6bfb18022..c7bcfe25f 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -3403,21 +3403,7 @@ DEFUN (no_match_local_pref, DEFUN (match_community, match_community_cmd, - "match community <(1-99)|(100-500)|WORD>", - MATCH_STR - "Match BGP community list\n" - "Community-list number (standard)\n" - "Community-list number (expanded)\n" - "Community-list name\n") -{ - int idx_comm_list = 2; - return bgp_route_match_add (vty, "community", argv[idx_comm_list]->arg, - RMAP_EVENT_CLIST_ADDED); -} - -DEFUN (match_community_exact, - match_community_exact_cmd, - "match community <(1-99)|(100-500)|WORD> exact-match", + "match community <(1-99)|(100-500)|WORD> [exact-match]", MATCH_STR "Match BGP community list\n" "Community-list number (standard)\n" @@ -3429,15 +3415,22 @@ DEFUN (match_community_exact, int ret; char *argstr; - argstr = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, - strlen (argv[idx_comm_list]->arg) + strlen ("exact-match") + 2); + if (argc == 4) + { + argstr = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, + strlen (argv[idx_comm_list]->arg) + + strlen ("exact-match") + 2); - sprintf (argstr, "%s exact-match", argv[idx_comm_list]->arg); + sprintf (argstr, "%s exact-match", argv[idx_comm_list]->arg); + } + else + argstr = argv[idx_comm_list]->arg; ret = bgp_route_match_add (vty, "community", argstr, RMAP_EVENT_CLIST_ADDED); - XFREE (MTYPE_ROUTE_MAP_COMPILED, argstr); + if (argstr != argv[idx_comm_list]->arg) + XFREE (MTYPE_ROUTE_MAP_COMPILED, argstr); return ret; } @@ -3459,7 +3452,7 @@ DEFUN (no_match_community, DEFUN (match_lcommunity, match_lcommunity_cmd, - "match large-community [<(1-99)|(100-500)|WORD>]", + "match large-community <(1-99)|(100-500)|WORD>", MATCH_STR "Match BGP large community list\n" "Large Community-list number (standard)\n" @@ -3685,7 +3678,7 @@ DEFUN (set_aspath_prepend_asn, DEFUN (set_aspath_prepend_lastas, set_aspath_prepend_lastas_cmd, - "set as-path prepend last-as (1-10)", + "set as-path prepend last-as (1-9)", SET_STR "Transform BGP AS_PATH attribute\n" "Prepend to the as-path\n" @@ -4399,7 +4392,7 @@ DEFUN (no_set_vpn_nexthop, DEFUN (set_ipx_vpn_nexthop, set_ipx_vpn_nexthop_cmd, - "set <ipv4|ipv6> vpn next-hop [<A.B.C.D|X:X::X:X>]", + "set <ipv4|ipv6> vpn next-hop <A.B.C.D|X:X::X:X>", SET_STR "IPv4 information\n" "IPv6 information\n" @@ -4478,12 +4471,11 @@ DEFUN (no_set_originator_id, "BGP originator ID attribute\n" "IP address of originator\n") { - int idx_id = 3; - if (argc < idx_id) - return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index), - "originator-id", NULL); + int idx = 0; + char *arg = argv_find (argv, argc, "A.B.C.D", &idx) ? argv[idx]->arg : NULL; + return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index), - "originator-id", argv[idx_id]->arg); + "originator-id", arg); } @@ -4588,7 +4580,6 @@ bgp_route_map_init (void) install_element (RMAP_NODE, &match_local_pref_cmd); install_element (RMAP_NODE, &no_match_local_pref_cmd); install_element (RMAP_NODE, &match_community_cmd); - install_element (RMAP_NODE, &match_community_exact_cmd); install_element (RMAP_NODE, &no_match_community_cmd); install_element (RMAP_NODE, &match_lcommunity_cmd); install_element (RMAP_NODE, &no_match_lcommunity_cmd); diff --git a/cumulus/start-stop-daemon.c b/cumulus/start-stop-daemon.c index a195e9e2f..c123f87e9 100644 --- a/cumulus/start-stop-daemon.c +++ b/cumulus/start-stop-daemon.c @@ -51,7 +51,7 @@ #include <grp.h> #include <sys/ioctl.h> #include <sys/types.h> -#include <sys/termios.h> +#include <termios.h> #include <fcntl.h> #include <limits.h> #include <assert.h> diff --git a/debian/changelog b/debian/changelog index ef019b4d2..88cb8df28 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -frr (2.0) Released; urgency=medium +frr (2.1) Released; urgency=medium * Switchover to FRR diff --git a/lib/memory.c b/lib/memory.c index f17915486..b1dc01ed9 100644 --- a/lib/memory.c +++ b/lib/memory.c @@ -40,6 +40,7 @@ mt_count_alloc (struct memtype *mt, size_t size) static inline void mt_count_free (struct memtype *mt) { + assert(mt->n_alloc); mt->n_alloc--; } diff --git a/lib/routemap.c b/lib/routemap.c index 70f3069a3..7be24dfda 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -2338,8 +2338,12 @@ DEFUN (no_match_tag, { VTY_DECLVAR_CONTEXT (route_map_index, index); + int idx = 0; + char *arg = argv_find (argv, argc, "(1-4294967295)", &idx) ? + argv[idx]->arg : NULL; + if (rmap_match_set_hook.no_match_tag) - return rmap_match_set_hook.no_match_tag (vty, index, "tag", argv[3]->arg, + return rmap_match_set_hook.no_match_tag (vty, index, "tag", arg, RMAP_EVENT_MATCH_DELETED); return CMD_SUCCESS; } @@ -2677,10 +2681,8 @@ DEFUN (rmap_onmatch_goto, "Goto Clause number\n" "Number\n") { - int idx_number = 2; - char *num = NULL; - num = argv[idx_number]->arg; - + int idx = 0; + char *num = argv_find (argv, argc, "(1-65535)", &idx) ? argv[idx]->arg : NULL; struct route_map_index *index = VTY_GET_CONTEXT (route_map_index); int d = 0; diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 88cc07e1a..643519e3f 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -1095,77 +1095,6 @@ route_map_command_status (struct vty *vty, int ret) return CMD_WARNING; } -/* add "match address" */ -DEFUN (ospf6_routemap_match_address_prefixlist, - ospf6_routemap_match_address_prefixlist_cmd, - "match ipv6 address prefix-list WORD", - "Match values\n" - IPV6_STR - "Match address of route\n" - "Match entries of prefix-lists\n" - "IPv6 prefix-list name\n") -{ - VTY_DECLVAR_CONTEXT(route_map_index, route_map_index); - int idx_word = 4; - int ret = route_map_add_match (route_map_index, - "ipv6 address prefix-list", argv[idx_word]->arg); - return route_map_command_status (vty, ret); -} - -/* delete "match address" */ -DEFUN (ospf6_routemap_no_match_address_prefixlist, - ospf6_routemap_no_match_address_prefixlist_cmd, - "no match ipv6 address prefix-list WORD", - NO_STR - "Match values\n" - IPV6_STR - "Match address of route\n" - "Match entries of prefix-lists\n" - "IPv6 prefix-list name\n") -{ - VTY_DECLVAR_CONTEXT(route_map_index, route_map_index); - int idx_word = 5; - int ret = route_map_delete_match (route_map_index, - "ipv6 address prefix-list", argv[idx_word]->arg); - return route_map_command_status (vty, ret); -} - -/* "match interface" */ -DEFUN (ospf6_routemap_match_interface, - ospf6_routemap_match_interface_cmd, - "match interface WORD", - MATCH_STR - "Match first hop interface of route\n" - "Interface name\n") -{ - VTY_DECLVAR_CONTEXT(route_map_index, route_map_index); - int idx_word = 2; - return route_map_add_match (route_map_index, - "interface", argv[idx_word]->arg); -} - -/* "no match interface WORD" */ -DEFUN (ospf6_routemap_no_match_interface, - ospf6_routemap_no_match_interface_cmd, - "no match interface [WORD]", - NO_STR - MATCH_STR - "Match first hop interface of route\n" - "Interface name\n") -{ - VTY_DECLVAR_CONTEXT(route_map_index, route_map_index); - int idx_word = 3; - int ret; - - if (argc == 4) - ret = route_map_delete_match (route_map_index, - "interface", argv[idx_word]->arg); - else - ret = route_map_delete_match (route_map_index, - "interface", NULL); - return route_map_command_status (vty, ret); -} - /* add "set metric-type" */ DEFUN (ospf6_routemap_set_metric_type, ospf6_routemap_set_metric_type_cmd, @@ -1230,35 +1159,6 @@ DEFUN (ospf6_routemap_no_set_forwarding, return route_map_command_status (vty, ret); } -/* add "set tag" */ -DEFUN (ospf6_routemap_set_tag, - ospf6_routemap_set_tag_cmd, - "set tag (1-4294967295)", - "Set value\n" - "Tag value for routing protocol\n" - "Tag value\n") -{ - VTY_DECLVAR_CONTEXT(route_map_index, route_map_index); - int ret = route_map_add_set (route_map_index, - "tag", argv[2]->arg); - return route_map_command_status (vty, ret); -} - -/* delete "set tag" */ -DEFUN (ospf6_routemap_no_set_tag, - ospf6_routemap_no_set_tag_cmd, - "no set tag [(1-4294967295)]", - NO_STR - "Set value\n" - "Tag value for routing protocol\n" - "Tag value\n") -{ - char *tag = (argc == 4) ? argv[3]->arg : NULL; - VTY_DECLVAR_CONTEXT (route_map_index, index); - int ret = route_map_delete_set (index, "tag", tag); - return route_map_command_status (vty, ret); -} - static void ospf6_routemap_init (void) { @@ -1279,14 +1179,6 @@ ospf6_routemap_init (void) route_map_install_set (&ospf6_routemap_rule_set_forwarding_cmd); route_map_install_set (&ospf6_routemap_rule_set_tag_cmd); - /* Match address prefix-list */ - install_element (RMAP_NODE, &ospf6_routemap_match_address_prefixlist_cmd); - install_element (RMAP_NODE, &ospf6_routemap_no_match_address_prefixlist_cmd); - - /* Match interface */ - install_element (RMAP_NODE, &ospf6_routemap_match_interface_cmd); - install_element (RMAP_NODE, &ospf6_routemap_no_match_interface_cmd); - /* ASE Metric Type (e.g. Type-1/Type-2) */ install_element (RMAP_NODE, &ospf6_routemap_set_metric_type_cmd); install_element (RMAP_NODE, &ospf6_routemap_no_set_metric_type_cmd); @@ -1294,10 +1186,6 @@ ospf6_routemap_init (void) /* ASE Metric */ install_element (RMAP_NODE, &ospf6_routemap_set_forwarding_cmd); install_element (RMAP_NODE, &ospf6_routemap_no_set_forwarding_cmd); - - /* Tag */ - install_element (RMAP_NODE, &ospf6_routemap_set_tag_cmd); - install_element (RMAP_NODE, &ospf6_routemap_no_set_tag_cmd); } diff --git a/pimd/pimd.c b/pimd/pimd.c index c9fd4d85f..2316cd08f 100644 --- a/pimd/pimd.c +++ b/pimd/pimd.c @@ -86,10 +86,9 @@ static void pim_free() if (qpim_static_route_list) list_free(qpim_static_route_list); - pim_route_map_terminate(); - pim_if_terminate (); pim_rp_free (); + pim_route_map_terminate(); zclient_lookup_free (); diff --git a/tests/common-cli.c b/tests/common-cli.c index 9cc1626fe..dc1f052bc 100644 --- a/tests/common-cli.c +++ b/tests/common-cli.c @@ -72,7 +72,7 @@ main (int argc, char **argv) /* Library inits. */ cmd_init (1); - host.name = strdup ("test"); + host.name = XSTRDUP(MTYPE_HOST,"test"); vty_init (master); memory_init (); diff --git a/zebra/zserv.c b/zebra/zserv.c index 6f72ad175..d8495dec0 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -2472,7 +2472,7 @@ DEFUN (show_zebra_client, "show zebra client", SHOW_STR "Zebra information\n" - "Client information") + "Client information\n") { struct listnode *node; struct zserv *client; @@ -2488,8 +2488,9 @@ DEFUN (show_zebra_client_summary, show_zebra_client_summary_cmd, "show zebra client summary", SHOW_STR - "Zebra information brief" - "Client information brief") + "Zebra information brief\n" + "Client information brief\n" + "Brief Summary\n") { struct listnode *node; struct zserv *client; |