* [LTP] [PATCH] sctp: sctputils.c: fix test_peer_addr()
@ 2015-06-22 15:31 Alexey Kodanev
2015-07-01 2:55 ` Hangbin Liu
0 siblings, 1 reply; 3+ messages in thread
From: Alexey Kodanev @ 2015-06-22 15:31 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
Test always fails with TBROK because inner loop will reset all the
previous set values if we use else branch.
Fixes 7cfe1586b8ed ("sctp: sctputil.c: make 'found' a static array")
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
utils/sctp/testlib/sctputil.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/utils/sctp/testlib/sctputil.c b/utils/sctp/testlib/sctputil.c
index c678072..564925c 100644
--- a/utils/sctp/testlib/sctputil.c
+++ b/utils/sctp/testlib/sctputil.c
@@ -371,6 +371,7 @@ int test_peer_addr(int sk, sctp_assoc_t asoc, sockaddr_storage_t *peers, int cou
socklen_t addrs_size = 0;
void *addrbuf;
char found[count];
+ memset(found, 0, count);
error = sctp_getpaddrs(sk, asoc, &addrs);
if (-1 == error) {
@@ -404,8 +405,6 @@ int test_peer_addr(int sk, sctp_assoc_t asoc, sockaddr_storage_t *peers, int cou
if (cmp_addr((sockaddr_storage_t *)sa_addr,
&peers[j]) == 0) {
found[j] = 1;
- } else {
- found[j] = 0;
}
}
}
--
1.7.1
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] sctp: sctputils.c: fix test_peer_addr()
2015-06-22 15:31 [LTP] [PATCH] sctp: sctputils.c: fix test_peer_addr() Alexey Kodanev
@ 2015-07-01 2:55 ` Hangbin Liu
2015-07-01 11:18 ` Alexey Kodanev
0 siblings, 1 reply; 3+ messages in thread
From: Hangbin Liu @ 2015-07-01 2:55 UTC (permalink / raw)
To: Alexey Kodanev; +Cc: vasily.isaenko, LTP list
I also got this issue while running sctp test and confirm this patch fixed the
problem. Please push this patch to the repo.
Thanks
Hangbin
2015-06-22 23:31 GMT+08:00 Alexey Kodanev <alexey.kodanev@oracle.com>:
> Test always fails with TBROK because inner loop will reset all the
> previous set values if we use else branch.
>
> Fixes 7cfe1586b8ed ("sctp: sctputil.c: make 'found' a static array")
>
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
> ---
> utils/sctp/testlib/sctputil.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/utils/sctp/testlib/sctputil.c b/utils/sctp/testlib/sctputil.c
> index c678072..564925c 100644
> --- a/utils/sctp/testlib/sctputil.c
> +++ b/utils/sctp/testlib/sctputil.c
> @@ -371,6 +371,7 @@ int test_peer_addr(int sk, sctp_assoc_t asoc, sockaddr_storage_t *peers, int cou
> socklen_t addrs_size = 0;
> void *addrbuf;
> char found[count];
> + memset(found, 0, count);
>
> error = sctp_getpaddrs(sk, asoc, &addrs);
> if (-1 == error) {
> @@ -404,8 +405,6 @@ int test_peer_addr(int sk, sctp_assoc_t asoc, sockaddr_storage_t *peers, int cou
> if (cmp_addr((sockaddr_storage_t *)sa_addr,
> &peers[j]) == 0) {
> found[j] = 1;
> - } else {
> - found[j] = 0;
> }
> }
> }
> --
> 1.7.1
>
>
> ------------------------------------------------------------------------------
> Monitor 25 network devices or servers for free with OpManager!
> OpManager is web-based network management software that monitors
> network devices and physical & virtual servers, alerts via email & sms
> for fault. Monitor 25 devices for free with no restriction. Download now
> http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] sctp: sctputils.c: fix test_peer_addr()
2015-07-01 2:55 ` Hangbin Liu
@ 2015-07-01 11:18 ` Alexey Kodanev
0 siblings, 0 replies; 3+ messages in thread
From: Alexey Kodanev @ 2015-07-01 11:18 UTC (permalink / raw)
To: Hangbin Liu; +Cc: vasily.isaenko, LTP list
Hi,
On 07/01/2015 05:55 AM, Hangbin Liu wrote:
> I also got this issue while running sctp test and confirm this patch fixed the
> problem. Please push this patch to the repo.
Applied.
Best regards,
Alexey
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-01 11:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-22 15:31 [LTP] [PATCH] sctp: sctputils.c: fix test_peer_addr() Alexey Kodanev
2015-07-01 2:55 ` Hangbin Liu
2015-07-01 11:18 ` Alexey Kodanev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox