BIER: missing endian swap for imposition object in API return 16/10016/2
authorNeale Ranns <neale.ranns@cisco.com>
Tue, 9 Jan 2018 12:11:28 +0000 (04:11 -0800)
committerNeale Ranns <nranns@cisco.com>
Tue, 9 Jan 2018 13:49:50 +0000 (13:49 +0000)
Change-Id: Iddd754d00ace3d042336e5c2c40431566275051a
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
src/vnet/bier/bier_api.c
test/test_bier.py
test/vpp_ip_route.py

index 9271258..3da6c19 100644 (file)
@@ -350,7 +350,7 @@ vl_api_bier_imp_add_t_handler (vl_api_bier_imp_add_t * mp)
     /* *INDENT-OFF* */
     REPLY_MACRO2 (VL_API_BIER_IMP_ADD_REPLY,
     ({
-        rmp->bi_index = bii;
+        rmp->bi_index = ntohl (bii);
     }));
     /* *INDENT-OM* */
 }
index e9c23fe..03ae52a 100644 (file)
@@ -470,10 +470,14 @@ class TestBier(VppTestCase):
         bier_route.add_vpp_config()
 
         #
-        # An imposition object with all bit-positions set
+        # An 2 imposition objects with all bit-positions set
+        # only use the second, but creating 2 tests with a non-zero
+        # value index in the route add
         #
         bi = VppBierImp(self, bti, 333, chr(0xff) * 32)
         bi.add_vpp_config()
+        bi2 = VppBierImp(self, bti, 334, chr(0xff) * 32)
+        bi2.add_vpp_config()
 
         #
         # Add a multicast route that will forward into the BIER doamin
@@ -488,7 +492,7 @@ class TestBier(VppTestCase):
                    VppMRoutePath(0xffffffff,
                                  MRouteItfFlags.MFIB_ITF_FLAG_FORWARD,
                                  proto=DpoProto.DPO_PROTO_BIER,
-                                 bier_imp=bi.bi_index)])
+                                 bier_imp=bi2.bi_index)])
         route_ing_232_1_1_1.add_vpp_config()
 
         #
index 3bc3b65..fedf130 100644 (file)
@@ -308,6 +308,7 @@ class VppIpMRoute(VppObject):
                                               path.nh_itf,
                                               path.nh_i_flags,
                                               table_id=self.table_id,
+                                              bier_imp=path.bier_imp,
                                               is_add=0,
                                               is_ipv6=self.is_ip6)