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/rip_interface.c | |
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/rip_interface.c')
-rw-r--r-- | ripd/rip_interface.c | 22 |
1 files changed, 8 insertions, 14 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(); |