summaryrefslogtreecommitdiffstats
path: root/zebra/zserv.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2016-12-12 21:28:31 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-12-14 19:21:08 +0100
commit88d88a9c7a8e1c6f361d154986e512d7a617c4ff (patch)
treeb902e76e09d178d34bd0b4813ba5c7c7ed755ee2 /zebra/zserv.c
parentldpd: remove security check to allow operation on unnumbered interfaces (diff)
downloadfrr-88d88a9c7a8e1c6f361d154986e512d7a617c4ff.tar.xz
frr-88d88a9c7a8e1c6f361d154986e512d7a617c4ff.zip
zebra/ldpd: allow MPLS ECMP on unnumbered interfaces
Signed-off-by: Renato Westphal <renato@opensourcerouting.org> (cherry picked from commit 7144dc12b55e05c9ae3d784dfb75817c9f881eb6)
Diffstat (limited to 'zebra/zserv.c')
-rw-r--r--zebra/zserv.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 61ea55f47..b7e45d8df 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -1665,6 +1665,7 @@ zread_mpls_labels (int command, struct zserv *client, u_short length,
struct prefix prefix;
enum nexthop_types_t gtype;
union g_addr gate;
+ ifindex_t ifindex;
mpls_label_t in_label, out_label;
u_int8_t distance;
struct zebra_vrf *zvrf;
@@ -1684,37 +1685,56 @@ zread_mpls_labels (int command, struct zserv *client, u_short length,
case AF_INET:
prefix.u.prefix4.s_addr = stream_get_ipv4 (s);
prefix.prefixlen = stream_getc (s);
- gtype = NEXTHOP_TYPE_IPV4;
gate.ipv4.s_addr = stream_get_ipv4 (s);
break;
case AF_INET6:
stream_get (&prefix.u.prefix6, s, 16);
prefix.prefixlen = stream_getc (s);
- gtype = NEXTHOP_TYPE_IPV6;
stream_get (&gate.ipv6, s, 16);
break;
default:
return;
}
+ ifindex = stream_getl (s);
distance = stream_getc (s);
in_label = stream_getl (s);
out_label = stream_getl (s);
+ switch (prefix.family)
+ {
+ case AF_INET:
+ if (ifindex)
+ gtype = NEXTHOP_TYPE_IPV4_IFINDEX;
+ else
+ gtype = NEXTHOP_TYPE_IPV4;
+ break;
+ case AF_INET6:
+ if (ifindex)
+ gtype = NEXTHOP_TYPE_IPV6_IFINDEX;
+ else
+ gtype = NEXTHOP_TYPE_IPV6;
+ break;
+ default:
+ return;
+ }
+
if (! mpls_enabled)
return;
if (command == ZEBRA_MPLS_LABELS_ADD)
{
mpls_lsp_install (zvrf, type, in_label, out_label, gtype, &gate,
- NULL, 0);
+ NULL, ifindex);
if (out_label != MPLS_IMP_NULL_LABEL)
- mpls_ftn_update (1, zvrf, type, &prefix, &gate, distance, out_label);
+ mpls_ftn_update (1, zvrf, type, &prefix, gtype, &gate, ifindex,
+ distance, out_label);
}
else if (command == ZEBRA_MPLS_LABELS_DELETE)
{
- mpls_lsp_uninstall (zvrf, type, in_label, gtype, &gate, NULL, 0);
+ mpls_lsp_uninstall (zvrf, type, in_label, gtype, &gate, NULL, ifindex);
if (out_label != MPLS_IMP_NULL_LABEL)
- mpls_ftn_update (0, zvrf, type, &prefix, &gate, distance, out_label);
+ mpls_ftn_update (0, zvrf, type, &prefix, gtype, &gate, ifindex,
+ distance, out_label);
}
}