srv6-mobile: Fix the localsid length issue on vnet/srv6 59/26059/1
authorTetsuya Murakami <tetsuya.mrk@gmail.com>
Sat, 21 Mar 2020 21:47:02 +0000 (14:47 -0700)
committerTetsuya Murakami <tetsuya.mrk@gmail.com>
Sat, 21 Mar 2020 21:47:02 +0000 (14:47 -0700)
Fix the following issue.

1. The localsid length was not stored in sr localsid structure.
2. SRv6 mobile test cases were modified based on the new sr localsid CLI syntax.

Type: fix

Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
Change-Id: Ieb7620c35439e90a599802a7e0dba61a39707349

src/plugins/srv6-mobile/extra/Dockerfile.j2
src/plugins/srv6-mobile/extra/Dockerfile.j2.release
src/plugins/srv6-mobile/test/test_srv6_mobile.py
src/vnet/srv6/sr_localsid.c

index ac58fa3..e8120bb 100644 (file)
@@ -15,6 +15,7 @@ RUN set -eux; \
     python3-cffi \
     asciidoc \
     xmlto \
+    libssl-dev \
     netcat; \
     rm -rf /var/lib/apt/lists/*; \
     mv /usr/sbin/tcpdump /usr/bin/tcpdump
index bdb57a6..7507f50 100644 (file)
@@ -17,6 +17,7 @@ RUN set -eux; \
     tcpdump \
     python3-cffi \
     python2.7 \
+    libssl-dev \
     netcat; \
     rm -rf /var/lib/apt/lists/*; \
     mv /usr/sbin/tcpdump /usr/bin/tcpdump
index ec94b8b..2ac37ce 100644 (file)
@@ -236,7 +236,7 @@ class TestSRv6EndMGTP6E(VppTestCase):
         pkts = self.create_packets([("A::1", "B::1"), ("C::1", "D::1")])
 
         self.vapi.cli(
-            "sr localsid prefix {}/64 behavior end.m.gtp6.e"
+            "sr localsid address {}/64 behavior end.m.gtp6.e"
             .format(pkts[0]['IPv6'].dst))
         self.vapi.cli(
             "ip route add a1::/64 via {}".format(self.ip6_nhop))
@@ -316,7 +316,7 @@ class TestSRv6EndMGTP6D(VppTestCase):
         self.vapi.cli("set sr encaps source addr A1::1")
         self.vapi.cli("sr policy add bsid D4:: next D2:: next D3::")
         self.vapi.cli(
-            "sr localsid prefix 2001::/64 behavior end.m.gtp6.d D4::/64")
+            "sr localsid address 2001::/64 behavior end.m.gtp6.d D4::/64")
         self.vapi.cli("ip route add D2::/64 via {}".format(self.ip6_nhop))
 
         self.logger.info(self.vapi.cli("show sr policies"))
index 2e8b10d..6af6b74 100755 (executable)
@@ -144,6 +144,11 @@ sr_cli_localsid (char is_del, ip6_address_t * localsid_addr,
       pref_length = plugin->prefix_length;
     }
 
+  if (localsid_prefix_len != 0)
+    {
+      pref_length = localsid_prefix_len;
+    }
+
   /* Check whether there exists a FIB entry with such address */
   fib_prefix_t pfx = {
     .fp_proto = FIB_PROTOCOL_IP6,
@@ -152,11 +157,7 @@ sr_cli_localsid (char is_del, ip6_address_t * localsid_addr,
 
   pfx.fp_addr.as_u64[0] = localsid_addr->as_u64[0];
   pfx.fp_addr.as_u64[1] = localsid_addr->as_u64[1];
-
-  if (pref_length != 0)
-    {
-      pfx.fp_len = pref_length;
-    }
+  pfx.fp_len = pref_length;
 
   /* Lookup the FIB index associated to the table id provided */
   u32 fib_index = fib_table_find (FIB_PROTOCOL_IP6, fib_table);