]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd rfapi: fix TT handling broken on Sat Jan 28 18:57:28 2017 -0500
authorLou Berger <lberger@labn.net>
Fri, 3 Feb 2017 00:50:36 +0000 (19:50 -0500)
committerLou Berger <lberger@labn.net>
Fri, 3 Feb 2017 02:53:48 +0000 (21:53 -0500)
Signed-off-by: Lou Berger <lberger@labn.net>
bgpd/rfapi/vnc_import_bgp.c

index 867c27fc63e67cf69b27b46dd9bedaa6172974b0..5b76d1870f96144a5528bd5a2c0235fee7161c2e 100644 (file)
@@ -466,6 +466,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)
@@ -509,6 +513,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
     {
@@ -533,7 +547,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 */