session: problem in session_rules_details API 79/41379/5
authorSteven Luong <[email protected]>
Wed, 7 Aug 2024 17:53:48 +0000 (10:53 -0700)
committerFlorin Coras <[email protected]>
Tue, 13 Aug 2024 17:41:23 +0000 (17:41 +0000)
Backend needs to return protocol to indicate if the prefix is ip4 or ip6.

Type: fix

Change-Id: If827c2e8b2a58051298968fa4d69de71ce9c4fcc
Signed-off-by: Steven Luong <[email protected]>
src/vnet/session/session_api.c

index 7110029..8bb3839 100644 (file)
@@ -1019,6 +1019,8 @@ send_session_rule_details4 (mma_rule_16_t * rule, u8 is_local,
   ip_set (&rmt.fp_addr, &match->rmt_ip, 1);
   lcl.fp_len = ip4_mask_to_preflen (&mask->lcl_ip);
   rmt.fp_len = ip4_mask_to_preflen (&mask->rmt_ip);
+  lcl.fp_proto = FIB_PROTOCOL_IP4;
+  rmt.fp_proto = FIB_PROTOCOL_IP4;
 
   ip_prefix_encode (&lcl, &rmp->lcl);
   ip_prefix_encode (&rmt, &rmp->rmt);
@@ -1061,6 +1063,8 @@ send_session_rule_details6 (mma_rule_40_t * rule, u8 is_local,
   ip_set (&rmt.fp_addr, &match->rmt_ip, 0);
   lcl.fp_len = ip6_mask_to_preflen (&mask->lcl_ip);
   rmt.fp_len = ip6_mask_to_preflen (&mask->rmt_ip);
+  lcl.fp_proto = FIB_PROTOCOL_IP6;
+  rmt.fp_proto = FIB_PROTOCOL_IP6;
 
   ip_prefix_encode (&lcl, &rmp->lcl);
   ip_prefix_encode (&rmt, &rmp->rmt);