public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [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

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