gbp: do not classify unknown packet as EP packets
[vpp.git] / src / plugins / gbp / gbp_api.c
index 76f0b21..db8c8c6 100644 (file)
@@ -331,6 +331,7 @@ gbp_bridge_domain_flags_from_api (vl_api_gbp_bridge_domain_flags_t a)
     g |= GBP_BD_FLAG_MCAST_DROP;
   if (a & GBP_BD_API_FLAG_UCAST_ARP)
     g |= GBP_BD_FLAG_UCAST_ARP;
+
   return (g);
 }
 
@@ -934,6 +935,7 @@ vl_api_gbp_contract_add_del_t_handler (vl_api_gbp_contract_add_del_t * mp)
 {
   vl_api_gbp_contract_add_del_reply_t *rmp;
   u16 *allowed_ethertypes;
+  u32 stats_index = ~0;
   index_t *rules;
   int ii, rv = 0;
   u8 n_et;
@@ -962,14 +964,19 @@ vl_api_gbp_contract_add_del_t_handler (vl_api_gbp_contract_add_del_t * mp)
       rv = gbp_contract_update (ntohs (mp->contract.sclass),
                                ntohs (mp->contract.dclass),
                                ntohl (mp->contract.acl_index),
-                               rules, allowed_ethertypes);
+                               rules, allowed_ethertypes, &stats_index);
     }
   else
     rv = gbp_contract_delete (ntohs (mp->contract.sclass),
                              ntohs (mp->contract.dclass));
 
 out:
-  REPLY_MACRO (VL_API_GBP_CONTRACT_ADD_DEL_REPLY + GBP_MSG_BASE);
+  /* *INDENT-OFF* */
+  REPLY_MACRO2 (VL_API_GBP_CONTRACT_ADD_DEL_REPLY + GBP_MSG_BASE,
+  ({
+    rmp->stats_index = htonl (stats_index);
+  }));
+  /* *INDENT-ON* */
 }
 
 static int
@@ -1191,7 +1198,7 @@ VLIB_API_INIT_FUNCTION (gbp_init);
 /* *INDENT-OFF* */
 VLIB_PLUGIN_REGISTER () = {
     .version = VPP_BUILD_VER,
-    .description = "Group Based Policy",
+    .description = "Group Based Policy (GBP)",
 };
 /* *INDENT-ON* */