From cb85f40c9c7ba31d36a6bf8143bd941ac9e1fad3 Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Thu, 2 Feb 2017 19:50:36 -0500 Subject: [PATCH] bgpd rfapi: fix TT handling broken on Sat Jan 28 18:57:28 2017 -0500 Signed-off-by: Lou Berger --- bgpd/rfapi/vnc_import_bgp.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bgpd/rfapi/vnc_import_bgp.c b/bgpd/rfapi/vnc_import_bgp.c index dca6a07497..8c7fd9066d 100644 --- a/bgpd/rfapi/vnc_import_bgp.c +++ b/bgpd/rfapi/vnc_import_bgp.c @@ -467,6 +467,10 @@ vnc_import_bgp_add_route_mode_resolve_nve_one_bi ( struct bgp_attr_encap_subtlv *encaptlvs; uint32_t label = 0; + struct rfapi_un_option optary[3]; + struct rfapi_un_option *opt = NULL; + int cur_opt = 0; + vnc_zlog_debug_verbose ("%s: entry", __func__); if (bi->type != ZEBRA_ROUTE_BGP && bi->type != ZEBRA_ROUTE_BGP_DIRECT) @@ -510,6 +514,16 @@ vnc_import_bgp_add_route_mode_resolve_nve_one_bi ( if (bi->attr && bi->attr->extra) { encaptlvs = bi->attr->extra->vnc_subtlvs; + if (bi->attr->extra->encap_tunneltype != BGP_ENCAP_TYPE_MPLS) + { + if (opt != NULL) + opt->next = &optary[cur_opt]; + opt = &optary[cur_opt++]; + memset (opt, 0, sizeof (struct rfapi_un_option)); + opt->type = RFAPI_UN_OPTION_TYPE_TUNNELTYPE; + opt->v.tunnel.type = bi->attr->extra->encap_tunneltype; + /* TBD parse bi->attr->extra->encap_subtlvs */ + } } else { @@ -534,7 +548,7 @@ vnc_import_bgp_add_route_mode_resolve_nve_one_bi ( local_pref, plifetime, (struct bgp_tea_options *) encaptlvs, /* RFP options */ - NULL, + opt, NULL, new_ecom, med, /* NULL => don't set med */ -- 2.39.5