summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vpp-api/java/jvpp/gen/jvpp_c_gen.py5
-rw-r--r--vpp/vpp-api/vpe.api8
2 files changed, 9 insertions, 4 deletions
diff --git a/vpp-api/java/jvpp/gen/jvpp_c_gen.py b/vpp-api/java/jvpp/gen/jvpp_c_gen.py
index 4d0ea0b51d1..1796ac1719b 100644
--- a/vpp-api/java/jvpp/gen/jvpp_c_gen.py
+++ b/vpp-api/java/jvpp/gen/jvpp_c_gen.py
@@ -412,6 +412,11 @@ def generate_msg_handlers(func_list, inputfile):
c_name = t[2]
field_length = t[3][0]
+ if jni_type.endswith('Array') and field_length == '0':
+ raise Exception('Variable array \'%s\' defined in message \'%s\' '
+ 'should have defined length (e.g. \'%s[%s_length]\''
+ % (c_name, handler_name, c_name, c_name))
+
# check if we are processing variable length array
if t[3][1]:
length_var_name = t[3][0]
diff --git a/vpp/vpp-api/vpe.api b/vpp/vpp-api/vpe.api
index 3e4b933b43d..50cfe2adf67 100644
--- a/vpp/vpp-api/vpe.api
+++ b/vpp/vpp-api/vpe.api
@@ -630,7 +630,7 @@ define vnet_interface_counters {
u8 is_combined;
u32 first_sw_if_index;
u32 count;
- u8 data[0];
+ u8 data[count];
};
typeonly manual_print manual_endian define ip4_fib_counter {
@@ -3979,7 +3979,7 @@ define mpls_gre_tunnel_details {
u32 tunnel_dst;
u32 outer_fib_index;
u32 nlabels;
- u32 labels[0];
+ u32 labels[nlabels];
};
/** \brief Dump mpls eth tunnel table
@@ -4017,7 +4017,7 @@ define mpls_eth_tunnel_details {
u8 tunnel_dst_mac[6];
u32 tx_sw_if_index;
u32 nlabels;
- u32 labels[0];
+ u32 labels[nlabels];
};
/** \brief Dump mpls fib table
@@ -4045,7 +4045,7 @@ define mpls_fib_encap_details {
u32 dest;
u32 s_bit;
u32 nlabels;
- u32 labels[0];
+ u32 labels[nlabels];
};
/** \brief Dump mpls fib decap table