summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpd/ldpd.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@cvs.openbsd.org>2016-05-23 18:36:56 +0000
committerRenato Westphal <renato@cvs.openbsd.org>2016-05-23 18:36:56 +0000
commit91a2d3e0814baccd85b9405c7abed7eeb129a355 (patch)
tree723a6a0edaca508f16725f6a8f23394a74608e3f /usr.sbin/ldpd/ldpd.c
parente20a03db287c83c833556d124aafc7811d7aac86 (diff)
Don't create l2vpn targeted neighbors inside the config parser.
When removing a configured pseudowire, we remove the associated tnbr in ldpe_l2vpn_pw_exit(). So, when a new pseudowire is configured, it makes sense to create its tnbr in ldpe_l2vpn_pw_init() to keep things consistent.
Diffstat (limited to 'usr.sbin/ldpd/ldpd.c')
-rw-r--r--usr.sbin/ldpd/ldpd.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/ldpd/ldpd.c b/usr.sbin/ldpd/ldpd.c
index b87dcf4f05c..5070735f691 100644
--- a/usr.sbin/ldpd/ldpd.c
+++ b/usr.sbin/ldpd/ldpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpd.c,v 1.39 2016/05/23 18:33:56 renato Exp $ */
+/* $OpenBSD: ldpd.c,v 1.40 2016/05/23 18:36:55 renato Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -904,20 +904,19 @@ merge_l2vpn(struct ldpd_conf *xconf, struct l2vpn *l2vpn, struct l2vpn *xl)
LIST_FOREACH_SAFE(pw, &l2vpn->pw_list, entry, ptmp) {
/* find deleted pseudowires */
if ((xp = l2vpn_pw_find(xl, pw->ifindex)) == NULL) {
- LIST_REMOVE(pw, entry);
-
switch (ldpd_process) {
case PROC_LDE_ENGINE:
- l2vpn_pw_del(pw);
+ l2vpn_pw_exit(pw);
break;
case PROC_LDP_ENGINE:
ldpe_l2vpn_pw_exit(pw);
- free(pw);
break;
case PROC_MAIN:
- free(pw);
break;
}
+
+ LIST_REMOVE(pw, entry);
+ free(pw);
}
}
LIST_FOREACH_SAFE(xp, &xl->pw_list, entry, ptmp) {
@@ -954,7 +953,7 @@ merge_l2vpn(struct ldpd_conf *xconf, struct l2vpn *l2vpn, struct l2vpn *xl)
switch (ldpd_process) {
case PROC_LDE_ENGINE:
- l2vpn_pw_del(pw);
+ l2vpn_pw_exit(pw);
l2vpn_pw_init(xp);
break;
case PROC_LDP_ENGINE: