diff options
author | Don Slice <dslice@cumulusnetworks.com> | 2016-04-02 01:16:20 +0200 |
---|---|---|
committer | Don Slice <dslice@cumulusnetworks.com> | 2016-04-02 01:16:20 +0200 |
commit | 81515efc8d03d94b25ef7fa3381195c2881ca87f (patch) | |
tree | 2097724cc2ee7e9129a3f8c6bd65ba8bf3cb7fce | |
parent | zebra: close all tables when quagga is stopped (diff) | |
parent | Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga in... (diff) | |
download | frr-81515efc8d03d94b25ef7fa3381195c2881ca87f.tar.xz frr-81515efc8d03d94b25ef7fa3381195c2881ca87f.zip |
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
-rw-r--r-- | bgpd/bgpd.c | 1 | ||||
-rw-r--r-- | lib/vrf.c | 4 | ||||
-rw-r--r-- | vtysh/vtysh_main.c | 24 | ||||
-rw-r--r-- | zebra/main.c | 10 |
4 files changed, 26 insertions, 13 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 7b3f4bb6c..8a8beea47 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -1409,6 +1409,7 @@ peer_create (union sockunion *su, const char *conf_if, struct bgp *bgp, if (conf_if) { peer->conf_if = XSTRDUP (MTYPE_PEER_CONF_IF, conf_if); + bgp_peer_conf_if_to_su_update(peer); if (peer->host) XFREE(MTYPE_BGP_PEER_HOST, peer->host); peer->host = XSTRDUP (MTYPE_BGP_PEER_HOST, conf_if); @@ -107,11 +107,9 @@ vrf_create (const char *name, size_t namelen) UNSET_FLAG(vrfp->status, ZEBRA_VRF_ACTIVE); - /* Pending: - Make sure this 0 vrf-id isnt taken as default vrf - - See if calling the the new_hook here is ok, may need to make the attached callback re-entrant. if (vrf_master.vrf_new_hook) (*vrf_master.vrf_new_hook) (0, name, &vrfp->info); - */ + return vrfp; } diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c index d8b769ba2..a063425ff 100644 --- a/vtysh/vtysh_main.c +++ b/vtysh/vtysh_main.c @@ -33,6 +33,7 @@ #include "getopt.h" #include "command.h" #include "memory.h" +#include "privs.h" #include "vtysh/vtysh.h" #include "vtysh/vtysh_user.h" @@ -40,6 +41,27 @@ /* VTY shell program name. */ char *progname; +static zebra_capabilities_t _caps_p [] = +{ + ZCAP_BIND, + ZCAP_NET_RAW, + ZCAP_NET_ADMIN, +}; + +struct zebra_privs_t vtysh_privs = +{ +#if defined(QUAGGA_USER) && defined(QUAGGA_GROUP) + .user = QUAGGA_USER, + .group = QUAGGA_GROUP, +#endif +#ifdef VTY_GROUP + .vty_group = VTY_GROUP, +#endif + .caps_p = _caps_p, + .cap_num_p = array_size(_caps_p), + .cap_num_i = 0, +}; + /* Configuration file name and directory. */ char config_default[] = SYSCONFDIR VTYSH_DEFAULT_CONFIG; char quagga_config_default[] = SYSCONFDIR QUAGGA_DEFAULT_CONFIG; @@ -303,6 +325,8 @@ main (int argc, char **argv, char **env) line_read = NULL; setlinebuf(stdout); + zprivs_init (&vtysh_privs); + /* Signal and others. */ vtysh_signal_init (); diff --git a/zebra/main.c b/zebra/main.c index b3571c26f..ea3aee659 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -304,22 +304,12 @@ static int zebra_vrf_delete (vrf_id_t vrf_id, const char *name, void **info) { struct zebra_vrf *zvrf = (struct zebra_vrf *) (*info); - struct listnode *list_node; - struct interface *ifp; assert (zvrf); rib_close_table (zvrf->table[AFI_IP][SAFI_UNICAST]); rib_close_table (zvrf->table[AFI_IP6][SAFI_UNICAST]); - for (ALL_LIST_ELEMENTS_RO (vrf_iflist (vrf_id), list_node, ifp)) - { - int operative = if_is_operative (ifp); - UNSET_FLAG (ifp->flags, IFF_UP); - if (operative) - if_down (ifp); - } - list_delete_all_node (zvrf->rid_all_sorted_list); list_delete_all_node (zvrf->rid_lo_sorted_list); |