diff options
author | Klement Sekera <ksekera@cisco.com> | 2020-06-09 14:17:45 +0000 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-06-10 11:11:07 +0000 |
commit | 35418ba491505318e0b08b372fcf1e9f0d45d80f (patch) | |
tree | 70a2abad4266eb2afb1f4bc112b43316c4f3389a /test | |
parent | ce53363d2018071df00ffddf2ffa13c4229139a8 (diff) |
vapi: memset allocated messages to zero
This avoids using dirty data from shared memory by client.
Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I96eecf655bf344ec29609cedbd8dc891b572e207
Diffstat (limited to 'test')
-rw-r--r-- | test/ext/vapi_c_test.c | 12 | ||||
-rw-r--r-- | test/ext/vapi_cpp_test.cpp | 8 |
2 files changed, 0 insertions, 20 deletions
diff --git a/test/ext/vapi_c_test.c b/test/ext/vapi_c_test.c index b5075e96c10..0247933f605 100644 --- a/test/ext/vapi_c_test.c +++ b/test/ext/vapi_c_test.c @@ -526,9 +526,6 @@ START_TEST (test_loopbacks_1) dctx.last_called = false; clib_memset (&seen, 0, sizeof (seen)); dump = vapi_alloc_sw_interface_dump (ctx); - dump->payload.name_filter_valid = 0; - clib_memset (dump->payload.name_filter.buf, 0, - dump->payload.name_filter.length); while (VAPI_EAGAIN == (rv = vapi_sw_interface_dump (ctx, dump, sw_interface_dump_cb, @@ -558,9 +555,6 @@ START_TEST (test_loopbacks_1) dctx.last_called = false; clib_memset (&seen, 0, sizeof (seen)); dump = vapi_alloc_sw_interface_dump (ctx); - dump->payload.name_filter_valid = 0; - clib_memset (dump->payload.name_filter.buf, 0, - dump->payload.name_filter.length); while (VAPI_EAGAIN == (rv = vapi_sw_interface_dump (ctx, dump, sw_interface_dump_cb, &dctx))) @@ -683,9 +677,6 @@ START_TEST (test_loopbacks_2) clib_memset (&seen, 0, sizeof (seen)); sw_interface_dump_ctx dctx = { false, num_ifs, sw_if_indexes, seen, 0 }; vapi_msg_sw_interface_dump *dump = vapi_alloc_sw_interface_dump (ctx); - dump->payload.name_filter_valid = 0; - clib_memset (dump->payload.name_filter.buf, 0, - dump->payload.name_filter.length); while (VAPI_EAGAIN == (rv = vapi_sw_interface_dump (ctx, dump, sw_interface_dump_cb, &dctx))) @@ -724,9 +715,6 @@ START_TEST (test_loopbacks_2) clib_memset (&seen, 0, sizeof (seen)); dctx.last_called = false; dump = vapi_alloc_sw_interface_dump (ctx); - dump->payload.name_filter_valid = 0; - clib_memset (dump->payload.name_filter.buf, 0, - dump->payload.name_filter.length); while (VAPI_EAGAIN == (rv = vapi_sw_interface_dump (ctx, dump, sw_interface_dump_cb, &dctx))) diff --git a/test/ext/vapi_cpp_test.cpp b/test/ext/vapi_cpp_test.cpp index 284b211eb81..ee0a9f38d3e 100644 --- a/test/ext/vapi_cpp_test.cpp +++ b/test/ext/vapi_cpp_test.cpp @@ -147,8 +147,6 @@ START_TEST (test_loopbacks_1) bool seen[num_ifs] = {0}; Sw_interface_dump d (con); auto &p = d.get_request ().get_payload (); - p.name_filter_valid = 0; - memset (p.name_filter.buf, 0, p.name_filter.length); auto rv = d.execute (); ck_assert_int_eq (VAPI_OK, rv); WAIT_FOR_RESPONSE (d, rv); @@ -189,8 +187,6 @@ START_TEST (test_loopbacks_1) { // new context Sw_interface_dump d (con); auto &p = d.get_request ().get_payload (); - p.name_filter_valid = 0; - memset (p.name_filter.buf, 0, p.name_filter.length); auto rv = d.execute (); ck_assert_int_eq (VAPI_OK, rv); WAIT_FOR_RESPONSE (d, rv); @@ -307,8 +303,6 @@ START_TEST (test_loopbacks_2) Sw_interface_dump_cb<num_ifs> swdcb (ccbs); Sw_interface_dump d (con, std::ref (swdcb)); auto &p = d.get_request ().get_payload (); - p.name_filter_valid = 0; - memset (p.name_filter.buf, 0, p.name_filter.length); auto rv = d.execute (); ck_assert_int_eq (VAPI_OK, rv); WAIT_FOR_RESPONSE (d, rv); @@ -336,8 +330,6 @@ START_TEST (test_loopbacks_2) { // new context Sw_interface_dump d (con); auto &p = d.get_request ().get_payload (); - p.name_filter_valid = 0; - memset (p.name_filter.buf, 0, p.name_filter.length); auto rv = d.execute (); ck_assert_int_eq (VAPI_OK, rv); WAIT_FOR_RESPONSE (d, rv); |