summaryrefslogtreecommitdiffstats
path: root/ldpd/interface.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-03-30 16:33:08 +0200
committerRenato Westphal <renato@opensourcerouting.org>2017-03-31 18:51:53 +0200
commit1d75a89d8553caab99e58668af30a9803d40d49b (patch)
treebdfdc77f6f84973d2fe3e27a1da6d0fa1b75a322 /ldpd/interface.c
parentldpd: extend the ldp_config_normalize() function (diff)
downloadfrr-1d75a89d8553caab99e58668af30a9803d40d49b.tar.xz
frr-1d75a89d8553caab99e58668af30a9803d40d49b.zip
ldpd: do not consume vty_conf when updating the configuration
David Lamparter gave the idea of keeping vty_conf as a permanent copy of ldpd_conf in order to simplify the CLI code and facilitate the integration with his cap'n proto framework in the future. Doing this demanded quite some effort but it was worth it as the code looks much better now. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ldpd/interface.c')
-rw-r--r--ldpd/interface.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/ldpd/interface.c b/ldpd/interface.c
index 11bce12b0..b7f473d39 100644
--- a/ldpd/interface.c
+++ b/ldpd/interface.c
@@ -62,21 +62,35 @@ if_new(const char *name)
iface->ipv4.af = AF_INET;
iface->ipv4.iface = iface;
iface->ipv4.enabled = 0;
- iface->ipv4.state = IF_STA_DOWN;
- RB_INIT(&iface->ipv4.adj_tree);
/* ipv6 */
iface->ipv6.af = AF_INET6;
iface->ipv6.iface = iface;
iface->ipv6.enabled = 0;
- iface->ipv6.state = IF_STA_DOWN;
- RB_INIT(&iface->ipv6.adj_tree);
return (iface);
}
void
-if_exit(struct iface *iface)
+ldpe_if_init(struct iface *iface)
+{
+ log_debug("%s: interface %s", __func__, iface->name);
+
+ LIST_INIT(&iface->addr_list);
+
+ /* ipv4 */
+ iface->ipv4.iface = iface;
+ iface->ipv4.state = IF_STA_DOWN;
+ RB_INIT(&iface->ipv4.adj_tree);
+
+ /* ipv6 */
+ iface->ipv6.iface = iface;
+ iface->ipv6.state = IF_STA_DOWN;
+ RB_INIT(&iface->ipv6.adj_tree);
+}
+
+void
+ldpe_if_exit(struct iface *iface)
{
struct if_addr *if_addr;