examples/ipsec-secgw: fix ESP flow error log
authorPraveen Shetty <praveen.shetty@intel.com>
Wed, 6 May 2020 11:02:41 +0000 (12:02 +0100)
committerAkhil Goyal <akhil.goyal@nxp.com>
Mon, 11 May 2020 11:17:43 +0000 (13:17 +0200)
Function create_ipsec_esp_flow returns a negative number in case of any
failure and we are passing this to strerror to display the error message.
But strerror()'s argument cannot be negative.
In case of failure, displaying exact error message to console is handled
in create_ipsec_esp_flow function.
So it is not required to print the error message again using strerror.
This patch will remove the unnecessary calling of strerror function
to fix the negative argument passing to strerror issue.

Coverity issue: 357691
Fixes: 6738c0a95695 ("examples/ipsec-secgw: support flow director")

Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
examples/ipsec-secgw/sa.c

index e3a1a5a..6324821 100644 (file)
@@ -1223,8 +1223,7 @@ sa_add_rules(struct sa_ctx *sa_ctx, const struct ipsec_sa entries[],
                        rc = create_ipsec_esp_flow(sa);
                        if (rc != 0)
                                RTE_LOG(ERR, IPSEC_ESP,
-                                       "create_ipsec_esp_flow() failed %s\n",
-                                       strerror(rc));
+                                       "create_ipsec_esp_flow() failed\n");
                }
                print_one_sa_rule(sa, inbound);
        }