tunnel: Fix API encoding of tunnel flags 83/36083/6
authorNeale Ranns <neale@graphiant.com>
Thu, 5 May 2022 06:07:20 +0000 (06:07 +0000)
committerNeale Ranns <neale@graphiant.com>
Thu, 11 Aug 2022 00:09:43 +0000 (00:09 +0000)
Type: fix

API and internal flags do not match 1:1.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I0f4e53b2e071d1c9fffd1b97bf28b4789887b032

src/vnet/tunnel/tunnel_types_api.c

index 894eecb..247c13c 100644 (file)
@@ -60,9 +60,14 @@ tunnel_flags_decode (vl_api_tunnel_flags_t f, tunnel_flags_t *o)
 }
 
 vl_api_tunnel_flags_t
-tunnel_flags_encode (tunnel_flags_t f)
+tunnel_flags_encode (tunnel_flags_t in)
 {
-  return ((vl_api_tunnel_flags_t) f);
+  vl_api_tunnel_flags_t out = 0;
+
+  if (in & TUNNEL_FLAG_TRACK_MTU)
+    out |= TUNNEL_API_FLAG_TRACK_MTU;
+
+  return (out);
 }
 
 int