diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2019-01-04 22:08:10 +0100 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2019-01-18 19:15:41 +0100 |
commit | 5a29c0d5c4e0529a1e721b4acfcd2463d371414d (patch) | |
tree | 51888fe45182fefcff35c321d01f1b71320f946e /ripd | |
parent | ripd: move "rip_enable_network" to the rip structure (diff) | |
download | frr-5a29c0d5c4e0529a1e721b4acfcd2463d371414d.tar.xz frr-5a29c0d5c4e0529a1e721b4acfcd2463d371414d.zip |
ripd: move "Vrip_passive_nondefault" to the rip structure
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripd')
-rw-r--r-- | ripd/rip_interface.c | 22 | ||||
-rw-r--r-- | ripd/ripd.c | 2 | ||||
-rw-r--r-- | ripd/ripd.h | 4 |
3 files changed, 13 insertions, 15 deletions
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index 86a144318..ca2fa24e4 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -60,9 +60,6 @@ const struct message ri_version_msg[] = {{RI_RIP_VERSION_1, "1"}, {RI_RIP_VERSION_NONE, "none"}, {0}}; -/* Vector to store passive-interface name. */ -vector Vrip_passive_nondefault; - /* Join to the RIP version 2 multicast group. */ static int ipv4_multicast_join(int sock, struct in_addr group, struct in_addr ifa, ifindex_t ifindex) @@ -1056,8 +1053,8 @@ static int rip_passive_nondefault_lookup(const char *ifname) unsigned int i; char *str; - for (i = 0; i < vector_active(Vrip_passive_nondefault); i++) - if ((str = vector_slot(Vrip_passive_nondefault, i)) != NULL) + for (i = 0; i < vector_active(rip->passive_nondefault); i++) + if ((str = vector_slot(rip->passive_nondefault, i)) != NULL) if (strcmp(str, ifname) == 0) return i; return -1; @@ -1100,7 +1097,7 @@ int rip_passive_nondefault_set(const char *ifname) */ return NB_OK; - vector_set(Vrip_passive_nondefault, + vector_set(rip->passive_nondefault, XSTRDUP(MTYPE_RIP_INTERFACE_STRING, ifname)); rip_passive_interface_apply_all(); @@ -1121,9 +1118,9 @@ int rip_passive_nondefault_unset(const char *ifname) */ return NB_OK; - str = vector_slot(Vrip_passive_nondefault, i); + str = vector_slot(rip->passive_nondefault, i); XFREE(MTYPE_RIP_INTERFACE_STRING, str); - vector_unset(Vrip_passive_nondefault, i); + vector_unset(rip->passive_nondefault, i); rip_passive_interface_apply_all(); @@ -1136,10 +1133,10 @@ void rip_passive_nondefault_clean(void) unsigned int i; char *str; - for (i = 0; i < vector_active(Vrip_passive_nondefault); i++) - if ((str = vector_slot(Vrip_passive_nondefault, i)) != NULL) { + for (i = 0; i < vector_active(rip->passive_nondefault); i++) + if ((str = vector_slot(rip->passive_nondefault, i)) != NULL) { XFREE(MTYPE_RIP_INTERFACE_STRING, str); - vector_slot(Vrip_passive_nondefault, i) = NULL; + vector_slot(rip->passive_nondefault, i) = NULL; } rip_passive_interface_apply_all(); } @@ -1222,9 +1219,6 @@ void rip_if_init(void) hook_register_prio(if_add, 0, rip_interface_new_hook); hook_register_prio(if_del, 0, rip_interface_delete_hook); - /* RIP passive interface. */ - Vrip_passive_nondefault = vector_init(1); - /* Install interface node. */ install_node(&interface_node, rip_interface_config_write); if_cmd_init(); diff --git a/ripd/ripd.c b/ripd/ripd.c index d099f9664..c7e2d6a24 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -2694,6 +2694,7 @@ int rip_create(int socket) rip->neighbor = route_table_init(); rip->enable_interface = vector_init(1); rip->enable_network = route_table_init(); + rip->passive_nondefault = vector_init(1); /* Distribute list install. */ rip->distribute_ctx = @@ -3377,6 +3378,7 @@ void rip_clean(void) rip_passive_nondefault_clean(); vector_free(rip->enable_interface); route_table_finish(rip->enable_network); + vector_free(rip->passive_nondefault); rip_offset_clean(); rip_interfaces_clean(); rip_distance_reset(); diff --git a/ripd/ripd.h b/ripd/ripd.h index 1f3b41e5f..97ad1fb08 100644 --- a/ripd/ripd.h +++ b/ripd/ripd.h @@ -150,6 +150,9 @@ struct rip { /* RIP enabled networks. */ struct route_table *enable_network; + /* Vector to store passive-interface name. */ + vector passive_nondefault; + /* For redistribute route map. */ struct { char *name; @@ -480,7 +483,6 @@ DECLARE_HOOK(rip_ifaddr_del, (struct connected * ifc), (ifc)) extern struct list *peer_list; extern struct route_table *rip_distance_table; -extern vector Vrip_passive_nondefault; /* Northbound. */ extern void rip_cli_init(void); |