examples/ipsec-secgw: resolve coverity issue
PATCH 1/1 examples/ipsec-secgw: resolve coverity issue
Function create_ipsec_esp_flow returns a negative number in case of any failure. But passing negative number to strerror is causing the coverity issue.
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 coverity issue.
Coverity issue: 357691
--- examples/ipsec-secgw/sa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
examples/ipsec-secgw/sa.c +1 -2
@@ -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); }
Signature · 1 line
2.17.1
W dniu 06.05.2020 o 11:02, Praveen Shetty pisze:
Quoted 23 lines
Function
create_ipsec_esp_flowreturns a negative number in case of any failure. But passing negative number to strerror is causing the coverity issue.
In case of failure, displaying exact error message to console is handled increate_ipsec_esp_flowfunction.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 coverity issue.Coverity issue: 357691
Fixes 6738c0a95695 ("examples/ipsec-secgw: support flow director")Signed-off-by Praveen Shetty <[email protected]>--- examples/ipsec-secgw/sa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)examples/ipsec-secgw/sa.c +0
-0
examples/ipsec-secgw/sa.c sa_add_rules(struct sa_ctx *sa_ctx, const struct ipsec_sa entries[], · line 1229
Quoted 9 lines
examples/ipsec-secgw/sa.c +1
-2@@ -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); }
great!, especially that create_ipsec_esp_flow returns mostly -1 in case of errors and that would be -EPERM ;)
Signature · 7 lines
Lukasz Wojciechowski Principal Software Engineer Samsung R&D Institute Poland Samsung Electronics Office +48 22 377 88 25 [email protected]
Hi Praveen,
Please see inline.
Thanks,
Anoob
Quoted 8 lines
-----Original Message-----
From: Praveen Shetty <[email protected]>
Sent: Wednesday, May 6, 2020 2:33 PM
To: [email protected]; [email protected]; [email protected]; Anoob Joseph <[email protected]>
Cc: [email protected]; [email protected]; [email protected]
Subject: [EXT] [PATCH v1] examples/ipsec-secgw: resolve coverity issue
[Anoob] I believe Thomas insists on explaining the issue that you are trying to fix rather than stating "resolve coverity issue" (which is too generic). So I guess you can remove all such references to coverity and retain rest of your description.
Quoted 38 lines
External Email
----------------------------------------------------------------------
Functioncreate_ipsec_esp_flowreturns a negative number in case of any failure. But passing negative number to strerror is causing the coverity issue. In case of failure, displaying exact error message to console is handled increate_ipsec_esp_flowfunction.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 coverity issue.Coverity issue: 357691
Fixes 6738c0a95695 ("examples/ipsec-secgw: support flow director")Signed-off-by Praveen Shetty <[email protected]>--- examples/ipsec-secgw/sa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)examples/ipsec-secgw/sa.c index renamed from examples/ipsec-secgw/sa.c +0
-0e3a1a5aff..632482176 100644
examples/ipsec-secgw/sa.c +1
-2@@ -1223,8 +1223,7 @@ sa_add_rules(struct sa_ctx *sa_ctx, const structipsec_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);}
--
2.17.1
Hi Anoob,
Thank you.
I have modified the commit message and headline accordingly and sent v2.
Regards,
Praveen
-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Wednesday, May 6, 2020 3:13 PM
To: Shetty, Praveen <[email protected]>; [email protected]; Doherty, Declan <[email protected]>; [email protected]
Cc: Iremonger, Bernard <[email protected]>; Ananyev, Konstantin <[email protected]>
Subject: RE: [EXT] [PATCH v1] examples/ipsec-secgw: resolve coverity issue
Hi Praveen,
Please see inline.
Thanks,
Anoob
Quoted 8 lines
-----Original Message-----
From: Praveen Shetty <[email protected]>
Sent: Wednesday, May 6, 2020 2:33 PM
To: [email protected]; [email protected]; [email protected]; Anoob Joseph <[email protected]>
Cc: [email protected]; [email protected]; [email protected]
Subject: [EXT] [PATCH v1] examples/ipsec-secgw: resolve coverity issue
[Anoob] I believe Thomas insists on explaining the issue that you are trying to fix rather than stating "resolve coverity issue" (which is too generic). So I guess you can remove all such references to coverity and retain rest of your description.
Quoted 39 lines
External Email
----------------------------------------------------------------------
Functioncreate_ipsec_esp_flowreturns a negative number in case of any failure. But passing negative number to strerror is causing the coverity issue. In case of failure, displaying exact error message to console is handled increate_ipsec_esp_flowfunction.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 coverity issue.Coverity issue: 357691
Fixes 6738c0a95695 ("examples/ipsec-secgw: support flow director")Signed-off-by Praveen Shetty <[email protected]>--- examples/ipsec-secgw/sa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)examples/ipsec-secgw/sa.c +0
-0index
e3a1a5aff..632482176 100644examples/ipsec-secgw/sa.c +1
-2@@ -1223,8 +1223,7 @@ sa_add_rules(struct sa_ctx *sa_ctx, const structipsec_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);}
--
2.17.1
PATCH v2 1/1 examples/ipsec-secgw: fix negative argument passing
In reply to Praveen ShettyFunction create_ipsec_esp_flow returns a negative number in case of any failure and we are passing this to strerror to dsiplay 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
---
v2 changes:
changed commit headline and rephrased commit message.
examples/ipsec-secgw/sa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
examples/ipsec-secgw/sa.c +1 -2
@@ -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); }
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v2] examples/ipsec-secgw: fix negative argument passing
W dniu 06.05.2020 o 12:37, Praveen Shetty pisze:
Quoted 2 lines
Function
create_ipsec_esp_flowreturns a negative number in case of any failure and we are passing this to strerror to dsiplay the error message.
typo dsiplay -> display
Quoted 34 lines
But strerror()'s argument cannot be negative.
In case of failure, displaying exact error message to console is handled increate_ipsec_esp_flowfunction.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 <[email protected]>---
v2 changes:
changed commit headline and rephrased commit message.examples/ipsec-secgw/sa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)examples/ipsec-secgw/sa.c +1
-2@@ -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); }
Signature · 7 lines
Lukasz Wojciechowski Principal Software Engineer Samsung R&D Institute Poland Samsung Electronics Office +48 22 377 88 25 [email protected]
Re: [dpdk-dev] [PATCH v2] examples/ipsec-secgw: fix negative argument passing
-----Original Message-----
From: Lukasz Wojciechowski <[email protected]>
Sent: Wednesday, May 6, 2020 4:20 PM
To: Shetty, Praveen <[email protected]>; [email protected]; Doherty, Declan <[email protected]>; [email protected]; [email protected]
Cc: Iremonger, Bernard <[email protected]>; Ananyev, Konstantin <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2] examples/ipsec-secgw: fix negative argument passing
W dniu 06.05.2020 o 12:37, Praveen Shetty pisze:
Quoted 2 lines
Function
create_ipsec_esp_flowreturns a negative number in case of any failure and we are passing this to strerror to dsiplay the error message.
typo dsiplay -> display
[Praveen] Thanks, fixed in v3.
Quoted 34 lines
But strerror()'s argument cannot be negative.
In case of failure, displaying exact error message to console is handled increate_ipsec_esp_flowfunction.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 <[email protected]>---
v2 changes:
changed commit headline and rephrased commit message.examples/ipsec-secgw/sa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)examples/ipsec-secgw/sa.c +1
-2@@ -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); }
Signature · 7 lines
Lukasz Wojciechowski Principal Software Engineer Samsung R&D Institute Poland Samsung Electronics Office +48 22 377 88 25 [email protected]
Lukasz Wojciechowski
Acked-byRe: [dpdk-dev] [PATCH v2] examples/ipsec-secgw: fix negative argument passing
W dniu 06.05.2020 o 13:03, Shetty, Praveen pisze:
Quoted 36 lines
-----Original Message-----
From: Lukasz Wojciechowski <[email protected]>
Sent: Wednesday, May 6, 2020 4:20 PM
To: Shetty, Praveen <[email protected]>; [email protected]; Doherty, Declan <[email protected]>; [email protected]; [email protected]
Cc: Iremonger, Bernard <[email protected]>; Ananyev, Konstantin <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2] examples/ipsec-secgw: fix negative argument passingW dniu 06.05.2020 o 12:37, Praveen Shetty pisze:
Quoted 2 lines
Function
create_ipsec_esp_flowreturns a negative number in case of any failure and we are passing this to strerror to dsiplay the error message.typo dsiplay -> display
[Praveen] Thanks, fixed in v3.
Quoted 20 lines
But strerror()'s argument cannot be negative.
In case of failure, displaying exact error message to console is handled increate_ipsec_esp_flowfunction.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 <[email protected]>---
v2 changes:
changed commit headline and rephrased commit message.examples/ipsec-secgw/sa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 14 lines
Quoted 5 lines
examples/ipsec-secgw/sa.c +0
-0examples/ipsec-secgw/sa.c sa_add_rules(struct sa_ctx *sa_ctx, const struct ipsec_sa entries[], · line 1229
Quoted 9 lines
examples/ipsec-secgw/sa.c +1
-2@@ -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); }
Quoted 1 line
Signature · 7 lines
Lukasz Wojciechowski Principal Software Engineer Samsung R&D Institute Poland Samsung Electronics Office +48 22 377 88 25 [email protected]
PATCH v3 1/1 examples/ipsec-secgw: fix negative argument passing
In reply to Praveen ShettyFunction 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
---
v3 changes:
fixed typo in commit message.
examples/ipsec-secgw/sa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
examples/ipsec-secgw/sa.c +1 -2
@@ -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); }
Signature · 1 line
2.17.1
Re: [dpdk-dev] [EXT] [PATCH v3] examples/ipsec-secgw: fix negative argument passing
Quoted 10 lines
Function
create_ipsec_esp_flowreturns 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 increate_ipsec_esp_flowfunction.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.
Quoted 6 lines
Coverity issue: 357691
Fixes 6738c0a95695 ("examples/ipsec-secgw: support flow director")Signed-off-by Praveen Shetty <[email protected]>
Akhil Goyal
AppliedRe: [dpdk-dev] [EXT] [PATCH v3] examples/ipsec-secgw: fix negative argument passing
Quoted 10 lines
Quoted 1 line
Function
create_ipsec_esp_flowreturns a negative number in case of anyfailure
Quoted 8 lines
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 increate_ipsec_esp_flowfunction.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.
Quoted 8 lines
Quoted 6 lines
Coverity issue: 357691
Fixes 6738c0a95695 ("examples/ipsec-secgw: support flow director")Signed-off-by Praveen Shetty <[email protected]>Acked-by Anoob Joseph <[email protected]>
Applied to dpdk-next-crypto
Thanks.