diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2020-07-22 07:41:41 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2020-07-22 07:41:41 -0700 |
commit | e1794d54a36fcc2d3c6304f3e4300c3f704e8adf (patch) | |
tree | 6613efd57d1ec9b33d4e15e429c380af99d22ea7 /rmnetctl/cli | |
parent | 7e6c2f017f032b6e4cee5f81ed35d37d70346a9a (diff) | |
parent | 0fb7abe717fab15465cc508e1952991147d96316 (diff) |
Change-Id: Ic85f2fc9b3a5edcb7875636997cad3cb0771cb25
Diffstat (limited to 'rmnetctl/cli')
-rw-r--r-- | rmnetctl/cli/rmnetcli.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/rmnetctl/cli/rmnetcli.c b/rmnetctl/cli/rmnetcli.c index 4e249a0..11184d7 100644 --- a/rmnetctl/cli/rmnetcli.c +++ b/rmnetctl/cli/rmnetcli.c @@ -2,7 +2,7 @@ R M N E T C L I . C -Copyright (c) 2013-2015, 2017-2019 The Linux Foundation. All rights reserved. +Copyright (c) 2013-2015, 2017-2020 The Linux Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -320,6 +320,8 @@ static int rmnet_api_call(int argc, char *argv[]) struct rmnetctl_hndl_s *handle = NULL; uint16_t error_number = RMNETCTL_CFG_FAILURE_NO_COMMAND; int return_code = RMNETCTL_LIB_ERR; + int is_new_api = 0; + if ((!argc) || (!*argv)) { print_rmnet_api_status(RMNETCTL_LIB_ERR, RMNETCTL_CFG_FAILURE_NO_COMMAND); @@ -332,6 +334,7 @@ static int rmnet_api_call(int argc, char *argv[]) } if (!strcmp(*argv, "-n")) { + is_new_api = 1; return_code = rtrmnet_ctl_init(&handle, &error_number); if (return_code != RMNETCTL_SUCCESS) { print_rmnet_api_status(return_code, error_number); @@ -424,6 +427,7 @@ static int rmnet_api_call(int argc, char *argv[]) _RMNETCLI_CHECKNULL(argv[3]); _RMNETCLI_CHECKNULL(argv[4]); _RMNETCLI_CHECKNULL(argv[5]); + _RMNETCLI_CHECKNULL(argv[6]); return_code = rtrmnet_activate_flow(handle, argv[1], argv[2], _STRTOUI8(argv[3]), @@ -631,8 +635,10 @@ static int rmnet_api_call(int argc, char *argv[]) } end: print_rmnet_api_status(return_code, error_number); - rmnetctl_cleanup(handle); - rtrmnet_ctl_deinit(handle); + if (is_new_api) + rtrmnet_ctl_deinit(handle); + else + rmnetctl_cleanup(handle); return return_code; } |