{
struct test_ping_req *prq = &req->tsr_u.ping;
- prq->png_size = param->png_size;
- prq->png_flags = param->png_flags;
- /* TODO dest */
- return 0;
+ if (param) {
+ prq->png_size = param->png_size;
+ prq->png_flags = param->png_flags;
+ } else {
+ prq->png_size = 0;
+ prq->png_flags = 0;
+ }
+ /* TODO dest */
+ return 0;
}
static int
trq->tsr_stop_onerr = !!test->tes_stop_onerr;
switch (test->tes_type) {
- case LST_TEST_PING:
- trq->tsr_service = SRPC_SERVICE_PING;
- rc = lstcon_pingrpc_prep((struct lst_test_ping_param *)
- &test->tes_param[0], trq);
- break;
+ case LST_TEST_PING: {
+ struct lst_test_ping_param *data = NULL;
+
+ trq->tsr_service = SRPC_SERVICE_PING;
+ if (test->tes_paramlen)
+ data = ((struct lst_test_ping_param *)
+ &test->tes_param[0]);
+ rc = lstcon_pingrpc_prep(data, trq);
+ break;
+ }
case LST_TEST_BULK:
trq->tsr_service = SRPC_SERVICE_BRW;
if ((feats & LST_FEAT_BULK_LEN) == 0) {
lst_get_test_param(char *test, int argc, char **argv, void **param, int *plen)
{
struct lst_test_bulk_param *bulk = NULL;
+ struct lst_test_ping_param *ping = NULL;
int type;
type = lst_test_name2type(test);
switch (type) {
case LST_TEST_PING:
- break;
+ /* unused but needs for kernel part */
+ ping = malloc(sizeof(*ping));
+ if (ping == NULL) {
+ fprintf(stderr, "Out of memory\n");
+ return -1;
+ }
+ memset(ping, 0, sizeof(*ping));
+
+ *param = ping;
+ *plen = sizeof(*ping);
+
+ break;
case LST_TEST_BULK:
bulk = malloc(sizeof(*bulk));