From 9128637ee8f7b0d903551f165a1447d427e8dd19 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 5 Dec 2017 13:24:04 -0800 Subject: BIER in non-MPLS netowrks as decsribed in section 2.2 ihttps://tools.ietf.org/html/draft-ietf-bier-mpls-encapsulation-10 with BIFT encoding from: https://tools.ietf.org/html/draft-wijnandsxu-bier-non-mpls-bift-encoding-00 changes: 1 - introduce the new BIFT lookup table. BIER tables that have an associated MPLS label are added to the MPLS-FIB. Those that don't are added to the BIER table 2 - BIER routes that have no associated output MPLS label will add a BIFT label. 3 - The BIER FMask has a path-list as a member to resolve via any possible path. Change-Id: I1fd4d9dbd074f0e855c16e9329b81460ebe1efce Signed-off-by: Neale Ranns --- src/vnet/bier/bier_output.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/vnet/bier/bier_output.c') diff --git a/src/vnet/bier/bier_output.c b/src/vnet/bier/bier_output.c index fce6c50b309..db115d3ad5e 100644 --- a/src/vnet/bier/bier_output.c +++ b/src/vnet/bier/bier_output.c @@ -89,9 +89,10 @@ bier_output (vlib_main_t * vm, bier_bit_string_t bbs; vlib_buffer_t * b0; bier_fmask_t *bfm0; + mpls_label_t *h0; bier_hdr_t *bh0; - u32 bi0, *h0; u32 bfmi0; + u32 bi0; bi0 = from[0]; to_next[0] = bi0; @@ -131,9 +132,16 @@ bier_output (vlib_main_t * vm, */ if (!(bfm0->bfm_flags & BIER_FMASK_FLAG_DISP)) { + /* + * since a BIFT value and a MPLS label are formated the + * same, this painting works OK. + */ vlib_buffer_advance(b0, -(word)sizeof(mpls_label_t)); h0 = vlib_buffer_get_current(b0); + h0[0] = bfm0->bfm_label; + vnet_mpls_uc_set_ttl(h0, vnet_buffer(b0)->mpls.ttl - 1); + h0[0] = clib_host_to_net_u32(h0[0]); } /* -- cgit 1.2.3-korg