test_connect.c | test_connect.c | |||
---|---|---|---|---|
skipping to change at line 61 | skipping to change at line 61 | |||
#include <sctputil.h> | #include <sctputil.h> | |||
char *TCID = __FILE__; | char *TCID = __FILE__; | |||
int TST_TOTAL = 5; | int TST_TOTAL = 5; | |||
int TST_CNT = 0; | int TST_CNT = 0; | |||
int | int | |||
main(int argc, char *argv[]) | main(int argc, char *argv[]) | |||
{ | { | |||
int svr_sk, clt_sk1, clt_sk2, peeloff_sk; | int svr_sk, clt_sk1, clt_sk2, peeloff_sk; | |||
sctp_assoc_t svr_associd1, svr_associd2, clt_associd1, clt_associd2; | sctp_assoc_t svr_associd1; | |||
sockaddr_storage_t svr_loop, clt_loop1, clt_loop2, clt_loop3; | sockaddr_storage_t svr_loop, clt_loop1, clt_loop2, clt_loop3; | |||
struct sctp_assoc_change *sac; | ||||
struct iovec iov; | struct iovec iov; | |||
struct msghdr inmessage; | struct msghdr inmessage; | |||
int error; | int error; | |||
struct sctp_assoc_change *sac; | ||||
char *big_buffer; | char *big_buffer; | |||
int flags; | int flags; | |||
/* Rather than fflush() throughout the code, set stdout to | /* Rather than fflush() throughout the code, set stdout to | |||
* be unbuffered. | * be unbuffered. | |||
*/ | */ | |||
setvbuf(stdout, NULL, _IONBF, 0); | setvbuf(stdout, NULL, _IONBF, 0); | |||
/* Initialize the server and client addresses. */ | /* Initialize the server and client addresses. */ | |||
svr_loop.v4.sin_family = AF_INET; | svr_loop.v4.sin_family = AF_INET; | |||
skipping to change at line 149 | skipping to change at line 149 | |||
iov.iov_len = REALLY_BIG; | iov.iov_len = REALLY_BIG; | |||
inmessage.msg_iov = &iov; | inmessage.msg_iov = &iov; | |||
inmessage.msg_iovlen = 1; | inmessage.msg_iovlen = 1; | |||
inmessage.msg_control = NULL; | inmessage.msg_control = NULL; | |||
/* Get COMM_UP on clt_sk1 */ | /* Get COMM_UP on clt_sk1 */ | |||
error = test_recvmsg(clt_sk1, &inmessage, MSG_WAITALL); | error = test_recvmsg(clt_sk1, &inmessage, MSG_WAITALL); | |||
test_check_msg_notification(&inmessage, error, | test_check_msg_notification(&inmessage, error, | |||
sizeof(struct sctp_assoc_change), | sizeof(struct sctp_assoc_change), | |||
SCTP_ASSOC_CHANGE, SCTP_COMM_UP); | SCTP_ASSOC_CHANGE, SCTP_COMM_UP); | |||
#if 0 | ||||
sac = (struct sctp_assoc_change *)iov.iov_base; | sac = (struct sctp_assoc_change *)iov.iov_base; | |||
clt_associd1 = sac->sac_assoc_id; | clt_associd1 = sac->sac_assoc_id; | |||
#endif | ||||
/* Get COMM_UP on svr_sk */ | /* Get COMM_UP on svr_sk */ | |||
error = test_recvmsg(svr_sk, &inmessage, MSG_WAITALL); | error = test_recvmsg(svr_sk, &inmessage, MSG_WAITALL); | |||
test_check_msg_notification(&inmessage, error, | test_check_msg_notification(&inmessage, error, | |||
sizeof(struct sctp_assoc_change), | sizeof(struct sctp_assoc_change), | |||
SCTP_ASSOC_CHANGE, SCTP_COMM_UP); | SCTP_ASSOC_CHANGE, SCTP_COMM_UP); | |||
sac = (struct sctp_assoc_change *)iov.iov_base; | sac = (struct sctp_assoc_change *)iov.iov_base; | |||
svr_associd1 = sac->sac_assoc_id; | svr_associd1 = sac->sac_assoc_id; | |||
/* Do a blocking connect from clt_sk2 to svr_sk. | /* Do a blocking connect from clt_sk2 to svr_sk. | |||
* Blocking connect should block until the association is establishe d | * Blocking connect should block until the association is establishe d | |||
* and return success. | * and return success. | |||
*/ | */ | |||
test_connect(clt_sk2, &svr_loop.sa, sizeof(svr_loop)); | test_connect(clt_sk2, &svr_loop.sa, sizeof(svr_loop)); | |||
/* Get COMM_UP on clt_sk2 */ | /* Get COMM_UP on clt_sk2 */ | |||
error = test_recvmsg(clt_sk2, &inmessage, MSG_WAITALL); | error = test_recvmsg(clt_sk2, &inmessage, MSG_WAITALL); | |||
test_check_msg_notification(&inmessage, error, | test_check_msg_notification(&inmessage, error, | |||
sizeof(struct sctp_assoc_change), | sizeof(struct sctp_assoc_change), | |||
SCTP_ASSOC_CHANGE, SCTP_COMM_UP); | SCTP_ASSOC_CHANGE, SCTP_COMM_UP); | |||
#if 0 | ||||
sac = (struct sctp_assoc_change *)iov.iov_base; | sac = (struct sctp_assoc_change *)iov.iov_base; | |||
clt_associd2 = sac->sac_assoc_id; | clt_associd2 = sac->sac_assoc_id; | |||
#endif | ||||
/* Get COMM_UP on svr_sk */ | /* Get COMM_UP on svr_sk */ | |||
error = test_recvmsg(svr_sk, &inmessage, MSG_WAITALL); | error = test_recvmsg(svr_sk, &inmessage, MSG_WAITALL); | |||
test_check_msg_notification(&inmessage, error, | test_check_msg_notification(&inmessage, error, | |||
sizeof(struct sctp_assoc_change), | sizeof(struct sctp_assoc_change), | |||
SCTP_ASSOC_CHANGE, SCTP_COMM_UP); | SCTP_ASSOC_CHANGE, SCTP_COMM_UP); | |||
#if 0 | ||||
sac = (struct sctp_assoc_change *)iov.iov_base; | sac = (struct sctp_assoc_change *)iov.iov_base; | |||
svr_associd2 = sac->sac_assoc_id; | svr_associd2 = sac->sac_assoc_id; | |||
#endif | ||||
tst_resm(TPASS, "blocking connect"); | tst_resm(TPASS, "blocking connect"); | |||
peeloff_sk = test_sctp_peeloff(svr_sk, svr_associd1); | peeloff_sk = test_sctp_peeloff(svr_sk, svr_associd1); | |||
/* Doing a connect on a peeled off socket should fail. */ | /* Doing a connect on a peeled off socket should fail. */ | |||
error = connect(peeloff_sk, &clt_loop3.sa, sizeof(clt_loop3)); | error = connect(peeloff_sk, &clt_loop3.sa, sizeof(clt_loop3)); | |||
if ((error != -1) || (EISCONN != errno)) | if ((error != -1) || (EISCONN != errno)) | |||
tst_brkm(TBROK, tst_exit, "connect on a peeled off socket " | tst_brkm(TBROK, tst_exit, "connect on a peeled off socket " | |||
"error:%d, errno:%d", error, errno); | "error:%d, errno:%d", error, errno); | |||
End of changes. 9 change blocks. | ||||
2 lines changed or deleted | 8 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |