summaryrefslogtreecommitdiffstats
path: root/ldpd/l2vpn.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-03-31 02:58:47 +0200
committerRenato Westphal <renato@opensourcerouting.org>2017-03-31 17:57:37 +0200
commit52b530fc64355933d428e2b88591cbf926b85bc8 (patch)
tree3aa1c68bb61da7fbd462b86aa0cada9ade2054c6 /ldpd/l2vpn.c
parentldpd: remove the interface vty node (diff)
downloadfrr-52b530fc64355933d428e2b88591cbf926b85bc8.tar.xz
frr-52b530fc64355933d428e2b88591cbf926b85bc8.zip
ldpd: fix configuration of non-existing VPLS interfaces and pseudowires
If we don't know the ifindex, flags, etc of an interface at the time it's configured, we should make sure that once this information is available the appropriate structures are updated. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ldpd/l2vpn.c')
-rw-r--r--ldpd/l2vpn.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/ldpd/l2vpn.c b/ldpd/l2vpn.c
index bdfcd420e..92d865210 100644
--- a/ldpd/l2vpn.c
+++ b/ldpd/l2vpn.c
@@ -117,7 +117,7 @@ l2vpn_if_compare(struct l2vpn_if *a, struct l2vpn_if *b)
}
struct l2vpn_if *
-l2vpn_if_new(struct l2vpn *l2vpn, struct kif *kif)
+l2vpn_if_new(struct l2vpn *l2vpn, const char *ifname)
{
struct l2vpn_if *lif;
@@ -125,9 +125,7 @@ l2vpn_if_new(struct l2vpn *l2vpn, struct kif *kif)
fatal("l2vpn_if_new: calloc");
lif->l2vpn = l2vpn;
- strlcpy(lif->ifname, kif->ifname, sizeof(lif->ifname));
- lif->ifindex = kif->ifindex;
- lif->flags = kif->flags;
+ strlcpy(lif->ifname, ifname, sizeof(lif->ifname));
return (lif);
}
@@ -141,6 +139,14 @@ l2vpn_if_find(struct l2vpn *l2vpn, const char *ifname)
}
void
+l2vpn_if_update_info(struct l2vpn_if *lif, struct kif *kif)
+{
+ lif->ifindex = kif->ifindex;
+ lif->flags = kif->flags;
+ memcpy(lif->mac, kif->mac, sizeof(lif->mac));
+}
+
+void
l2vpn_if_update(struct l2vpn_if *lif)
{
struct l2vpn *l2vpn = lif->l2vpn;
@@ -174,7 +180,7 @@ l2vpn_pw_compare(struct l2vpn_pw *a, struct l2vpn_pw *b)
}
struct l2vpn_pw *
-l2vpn_pw_new(struct l2vpn *l2vpn, struct kif *kif)
+l2vpn_pw_new(struct l2vpn *l2vpn, const char *ifname)
{
struct l2vpn_pw *pw;
@@ -182,8 +188,7 @@ l2vpn_pw_new(struct l2vpn *l2vpn, struct kif *kif)
fatal("l2vpn_pw_new: calloc");
pw->l2vpn = l2vpn;
- strlcpy(pw->ifname, kif->ifname, sizeof(pw->ifname));
- pw->ifindex = kif->ifindex;
+ strlcpy(pw->ifname, ifname, sizeof(pw->ifname));
return (pw);
}
@@ -220,6 +225,12 @@ l2vpn_pw_find_inactive(struct l2vpn *l2vpn, const char *ifname)
}
void
+l2vpn_pw_update_info(struct l2vpn_pw *pw, struct kif *kif)
+{
+ pw->ifindex = kif->ifindex;
+}
+
+void
l2vpn_pw_init(struct l2vpn_pw *pw)
{
struct fec fec;