From 086aec2ad407bbea696e53666c4df51c0d1533c9 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sat, 18 Aug 2018 18:03:16 +0200 Subject: [PATCH] vtysh: make RPKI node non-conditional Whether or not RPKI is enabled during build shouldn't really influence vtysh; the user can always manually install bgpd_rpki.so later and it should work. This also means that the behaviour of "RPKI module not loaded" is consistent regardless of whether it was a compile-time or runtime decision. Signed-off-by: David Lamparter --- bgpd/subdir.am | 2 -- configure.ac | 3 +-- vtysh/vtysh.c | 11 ----------- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/bgpd/subdir.am b/bgpd/subdir.am index 7bb8b8ed8..f54fbab1f 100644 --- a/bgpd/subdir.am +++ b/bgpd/subdir.am @@ -26,9 +26,7 @@ vtysh_scan += \ # end # can be loaded as DSO - always include for vtysh -if RPKI vtysh_scan += $(top_srcdir)/bgpd/bgp_rpki.c -endif if ENABLE_BGP_VNC vtysh_scan += \ diff --git a/configure.ac b/configure.ac index 32aa17837..521d27a68 100755 --- a/configure.ac +++ b/configure.ac @@ -1975,8 +1975,7 @@ dnl Enable RPKI and add librtr to libs dnl ------------------------------------ if test "${enable_rpki}" = "yes"; then PKG_CHECK_MODULES(RTRLIB,[rtrlib >= 0.5.0], - [AC_DEFINE(HAVE_RPKI,1,Enable RPKI prefix validation for BGP) - RPKI=true], + [RPKI=true], [RPKI=false AC_MSG_ERROR([rtrlib was not found on your system or is too old.])] ) diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 39b756dda..6a92b9081 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -1257,9 +1257,7 @@ struct cmd_node link_params_node = { LINK_PARAMS_NODE, "%s(config-link-params)# ", }; -#if defined(HAVE_RPKI) static struct cmd_node rpki_node = {RPKI_NODE, "%s(config-rpki)# ", 1}; -#endif #if HAVE_BFDD > 0 static struct cmd_node bfd_node = { @@ -1429,7 +1427,6 @@ DEFUNSH(VTYSH_BGPD, address_family_ipv6_labeled_unicast, return CMD_SUCCESS; } -#if defined(HAVE_RPKI) DEFUNSH(VTYSH_BGPD, rpki, rpki_cmd, @@ -1440,8 +1437,6 @@ DEFUNSH(VTYSH_BGPD, return CMD_SUCCESS; } -#endif - DEFUNSH(VTYSH_BGPD, address_family_evpn, address_family_evpn_cmd, "address-family ", "Enter Address Family command mode\n" @@ -1884,7 +1879,6 @@ DEFUNSH(VTYSH_BGPD, exit_vnc_config, exit_vnc_config_cmd, "exit-vnc", } -#if defined(HAVE_RPKI) DEFUNSH(VTYSH_BGPD, rpki_exit, rpki_exit_cmd, "exit", "Exit current mode and down to previous mode\n") { @@ -1897,7 +1891,6 @@ DEFUNSH(VTYSH_BGPD, rpki_quit, rpki_quit_cmd, "quit", { return rpki_exit(self, vty, argc, argv); } -#endif /* HAVE_RPKI */ DEFUNSH(VTYSH_PIMD|VTYSH_ZEBRA, exit_vrf_config, exit_vrf_config_cmd, "exit-vrf", "Exit from VRF configuration mode\n") @@ -3525,9 +3518,7 @@ void vtysh_init_vty(void) install_node(&isis_node, NULL); install_node(&openfabric_node, NULL); install_node(&vty_node, NULL); -#if defined(HAVE_RPKI) install_node(&rpki_node, NULL); -#endif #if HAVE_BFDD > 0 install_node(&bfd_node, NULL); install_node(&bfd_peer_node, NULL); @@ -3766,12 +3757,10 @@ void vtysh_init_vty(void) install_element(BGP_FLOWSPECV4_NODE, &exit_address_family_cmd); install_element(BGP_FLOWSPECV6_NODE, &exit_address_family_cmd); -#if defined(HAVE_RPKI) install_element(CONFIG_NODE, &rpki_cmd); install_element(RPKI_NODE, &rpki_exit_cmd); install_element(RPKI_NODE, &rpki_quit_cmd); install_element(RPKI_NODE, &vtysh_end_all_cmd); -#endif /* EVPN commands */ install_element(BGP_EVPN_NODE, &bgp_evpn_vni_cmd); -- 2.39.5