| 1 | /* SCTP kernel Implementation |
| 2 | * (C) Copyright IBM Corp. 2001, 2003 |
| 3 | * Copyright (c) 1999-2000 Cisco, Inc. |
| 4 | * Copyright (c) 1999-2001 Motorola, Inc. |
| 5 | * Copyright (c) 2001 Intel Corp. |
| 6 | * Copyright (c) 2001 Nokia, Inc. |
| 7 | * |
| 8 | * The SCTP implementation is free software; |
| 9 | * you can redistribute it and/or modify it under the terms of |
| 10 | * the GNU General Public License as published by |
| 11 | * the Free Software Foundation; either version 2, or (at your option) |
| 12 | * any later version. |
| 13 | * |
| 14 | * The SCTP implementation is distributed in the hope that it |
| 15 | * will be useful, but WITHOUT ANY WARRANTY; without even the implied |
| 16 | * ************************ |
| 17 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 18 | * See the GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with GNU CC; see the file COPYING. If not, write to |
| 22 | * the Free Software Foundation, 59 Temple Place - Suite 330, |
| 23 | * Boston, MA 02111-1307, USA. |
| 24 | * |
| 25 | * Please send any bug reports or fixes you make to the |
| 26 | * email address(es): |
| 27 | * lksctp developers <[email protected]> |
| 28 | * |
| 29 | * Or submit a bug report through the following website: |
| 30 | * https://github.com/sctp/lksctp-tools/ |
| 31 | * |
| 32 | * Any bugs reported to us we will try to fix... any fixes shared will |
| 33 | * be incorporated into the next SCTP release. |
| 34 | * |
| 35 | * Written or modified by: |
| 36 | * Sridhar Samudrala <[email protected]> |
| 37 | */ |
| 38 | |
| 39 | /* This is a Functional test to verify the new SCTP interface sctp_peeloff() |
| 40 | * that can be used to branch off an association into a separate socket. |
| 41 | */ |
| 42 | |
| 43 | #include <stdio.h> |
| 44 | #include <unistd.h> |
| 45 | #include <stdlib.h> |
| 46 | #include <string.h> |
| 47 | #include <sys/types.h> |
| 48 | #include <sys/socket.h> |
| 49 | #include <sys/uio.h> |
| 50 | #include <netinet/in.h> |
| 51 | #include <errno.h> |
| 52 | #include <netinet/sctp.h>cxx . . $ `<file>/src/include/netinet/sctp.h`/ |
| 53 | #include <sctputil.h>cxx . . $ `<file>/src/testlib/sctputil.h`/ |
| 54 | |
| 55 | char *TCIDcxx . . $ TCID. = __FILE__; |
| 56 | int TST_TOTALcxx . . $ TST_TOTAL. = 6; |
| 57 | int TST_CNTcxx . . $ TST_CNT. = 0; |
| 58 | |
| 59 | #define MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`! 10 |
| 60 | |
| 61 | int |
| 62 | maincxx . . $ main(afcd3168fc1188a4).(int argc, char *argv[]) |
| 63 | { |
| 64 | int svr_sk, clt_sk[MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`!], peeloff_sk[MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`!]; |
| 65 | sctp_assoc_tcxx . . $ sctp_assoc_t# svr_associd[MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`!]; |
| 66 | sockaddr_storage_tcxx . . $ sockaddr_storage_t# svr_loop, clt_loop[MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`!]; |
| 67 | struct ioveccxx . . $ iovec# iov; |
| 68 | struct msghdrcxx . . $ msghdr# inmessage; |
| 69 | struct msghdrcxx . . $ msghdr# outmessage; |
| 70 | char incmsg[CMSG_SPACEcxx . . $ `<external>/8962547315054503424/socket.h:309:9`!(sizeof(sctp_cmsg_data_t))]; |
| 71 | char outcmsg[CMSG_SPACEcxx . . $ `<external>/8962547315054503424/socket.h:309:9`!(sizeof(struct sctp_sndrcvinfo))]; |
| 72 | struct cmsghdrcxx . . $ cmsghdr# *cmsg; |
| 73 | struct sctp_sndrcvinfocxx . . $ sctp_sndrcvinfo# *sinfo; |
| 74 | struct ioveccxx . . $ iovec# out_iov; |
| 75 | int error; |
| 76 | uint32_tcxx . . $ uint32_t# ppid; |
| 77 | uint32_tcxx . . $ uint32_t# stream; |
| 78 | struct sctp_assoc_changecxx . . $ sctp_assoc_change# *sac; |
| 79 | char *big_buffer; |
| 80 | int i; |
| 81 | char *message = "hello, world!\n"; |
| 82 | int pf_class; |
| 83 | |
| 84 | /* Rather than fflush() throughout the code, set stdout to |
| 85 | * be unbuffered. |
| 86 | */ |
| 87 | setvbufcxx . . $ setvbuf(4da3ba8c983f31bc).(stdoutcxx . . $ `<external>/232824719582829767/stdio.h:158:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, _IONBFcxx . . $ `<external>/232824719582829767/stdio.h:100:9`!, 0); |
| 88 | |
| 89 | #if TEST_V6 |
| 90 | pf_class = PF_INET6; |
| 91 | svr_loop.v6.sin6_family = AF_INET6; |
| 92 | svr_loop.v6.sin6_addr = in6addr_loopbackcxx . . $ in6addr_loopback.; |
| 93 | svr_loop.v6.sin6_port = htons(SCTP_TESTPORT_1); |
| 94 | #else |
| 95 | pf_class = PF_INETcxx . . $ `<external>/8962547315054503424/socket.h:45:9`!; |
| 96 | svr_loop.v4cxx . . $ $anonymous_type_f8e963888af85862_0#v4..sin_familycxx . . $ sockaddr_in#sin_family. = AF_INETcxx . . $ `<external>/8962547315054503424/socket.h:97:9`!; |
| 97 | svr_loop.v4cxx . . $ $anonymous_type_f8e963888af85862_0#v4..sin_addrcxx . . $ sockaddr_in#sin_addr..s_addrcxx . . $ in_addr#s_addr. = SCTP_IP_LOOPBACKcxx . . $ `src/testlib/sctputil.h:76:9`!; |
| 98 | svr_loop.v4cxx . . $ $anonymous_type_f8e963888af85862_0#v4..sin_portcxx . . $ sockaddr_in#sin_port. = htonscxx . . $ `<external>/9581057695539925927/in.h:431:12`!(SCTP_TESTPORT_1cxx . . $ `src/testlib/sctputil.h:71:9`!); |
| 99 | #endif |
| 100 | |
| 101 | /* Create and bind the server socket. */ |
| 102 | svr_sk = test_socketcxx . . $ test_socket(2326284602b0bb2d).(pf_class, SOCK_SEQPACKETcxx . . $ `<external>/5956532346368192945/socket_type.h:38:9`!, IPPROTO_SCTPcxx . . $ `<external>/9581057695539925927/in.h:87:9`!); |
| 103 | test_bindcxx . . $ test_bind(18e507052d945257).(svr_sk, &svr_loop.sacxx . . $ $anonymous_type_f8e963888af85862_0#sa., sizeof(svr_loop)); |
| 104 | |
| 105 | /* Enable ASSOC_CHANGE and SNDRCVINFO notifications. */ |
| 106 | test_enable_assoc_changecxx . . $ test_enable_assoc_change(d4f767463ce0a6b3).(svr_sk); |
| 107 | |
| 108 | /* Mark server socket as being able to accept new associations. */ |
| 109 | test_listencxx . . $ test_listen(9b79fb6aee4c0440).(svr_sk, 1); |
| 110 | |
| 111 | /* Create and bind all the client sockets. */ |
| 112 | for (i = 0; i < MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`!; i++) { |
| 113 | clt_sk[i] = test_socketcxx . . $ test_socket(2326284602b0bb2d).(pf_class, SOCK_SEQPACKETcxx . . $ `<external>/5956532346368192945/socket_type.h:38:9`!, IPPROTO_SCTPcxx . . $ `<external>/9581057695539925927/in.h:87:9`!); |
| 114 | #if TEST_V6 |
| 115 | clt_loop[i].v6.sin6_family = AF_INET6; |
| 116 | clt_loop[i].v6.sin6_addr = in6addr_loopbackcxx . . $ in6addr_loopback.; |
| 117 | clt_loop[i].v6.sin6_port = htons(SCTP_TESTPORT_2 + i); |
| 118 | #else |
| 119 | clt_loop[i].v4cxx . . $ $anonymous_type_f8e963888af85862_0#v4..sin_familycxx . . $ sockaddr_in#sin_family. = AF_INETcxx . . $ `<external>/8962547315054503424/socket.h:97:9`!; |
| 120 | clt_loop[i].v4cxx . . $ $anonymous_type_f8e963888af85862_0#v4..sin_addrcxx . . $ sockaddr_in#sin_addr..s_addrcxx . . $ in_addr#s_addr. = SCTP_IP_LOOPBACKcxx . . $ `src/testlib/sctputil.h:76:9`!; |
| 121 | clt_loop[i].v4cxx . . $ $anonymous_type_f8e963888af85862_0#v4..sin_portcxx . . $ sockaddr_in#sin_port. = htonscxx . . $ `<external>/9581057695539925927/in.h:431:12`!(SCTP_TESTPORT_2cxx . . $ `src/testlib/sctputil.h:73:9`! + i); |
| 122 | #endif |
| 123 | test_bindcxx . . $ test_bind(18e507052d945257).(clt_sk[i], &clt_loop[i].sacxx . . $ $anonymous_type_f8e963888af85862_0#sa., sizeof(clt_loop[i])); |
| 124 | |
| 125 | test_enable_assoc_changecxx . . $ test_enable_assoc_change(d4f767463ce0a6b3).(clt_sk[i]); |
| 126 | } |
| 127 | |
| 128 | /* Send the first message from all the clients to the server. This |
| 129 | * will create the associations. |
| 130 | */ |
| 131 | outmessage.msg_namecxx . . $ msghdr#msg_name. = &svr_loop; |
| 132 | outmessage.msg_namelencxx . . $ msghdr#msg_namelen. = sizeof(svr_loop); |
| 133 | outmessage.msg_iovcxx . . $ msghdr#msg_iov. = &out_iov; |
| 134 | outmessage.msg_iovlencxx . . $ msghdr#msg_iovlen. = 1; |
| 135 | outmessage.msg_controlcxx . . $ msghdr#msg_control. = outcmsg; |
| 136 | outmessage.msg_controllencxx . . $ msghdr#msg_controllen. = sizeof(outcmsg); |
| 137 | outmessage.msg_flagscxx . . $ msghdr#msg_flags. = 0; |
| 138 | cmsg = CMSG_FIRSTHDRcxx . . $ `<external>/8962547315054503424/socket.h:304:9`!(&outmessage); |
| 139 | cmsg->cmsg_levelcxx . . $ cmsghdr#cmsg_level. = IPPROTO_SCTPcxx . . $ `<external>/9581057695539925927/in.h:87:9`!; |
| 140 | cmsg->cmsg_typecxx . . $ cmsghdr#cmsg_type. = SCTP_SNDRCVcxx . . $ `<external>/17169092326581286071/sctp.h:333:9`!; |
| 141 | cmsg->cmsg_lencxx . . $ cmsghdr#cmsg_len. = CMSG_LENcxx . . $ `<external>/8962547315054503424/socket.h:311:9`!(sizeof(struct sctp_sndrcvinfo)); |
| 142 | outmessage.msg_controllencxx . . $ msghdr#msg_controllen. = cmsg->cmsg_lencxx . . $ cmsghdr#cmsg_len.; |
| 143 | sinfo = (struct sctp_sndrcvinfocxx . . $ sctp_sndrcvinfo# *)CMSG_DATAcxx . . $ `<external>/8962547315054503424/socket.h:299:10`!(cmsg); |
| 144 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(sinfo, 0x00, sizeof(struct sctp_sndrcvinfocxx . . $ sctp_sndrcvinfo#)); |
| 145 | ppid = randcxx . . $ rand(b126dc7c1de90089).(); /* Choose an arbitrary value. */ |
| 146 | stream = 1; |
| 147 | sinfo->sinfo_ppidcxx . . $ sctp_sndrcvinfo#sinfo_ppid. = ppid; |
| 148 | sinfo->sinfo_streamcxx . . $ sctp_sndrcvinfo#sinfo_stream. = stream; |
| 149 | outmessage.msg_iovcxx . . $ msghdr#msg_iov.->iov_basecxx . . $ iovec#iov_base. = message; |
| 150 | outmessage.msg_iovcxx . . $ msghdr#msg_iov.->iov_lencxx . . $ iovec#iov_len. = strlencxx . . $ strlen(751346f8406fd082).(message) + 1; |
| 151 | for (i = 0; i < MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`!; i++) |
| 152 | test_sendmsgcxx . . $ test_sendmsg(c45a39c477f473e).(clt_sk[i], &outmessage, 0, |
| 153 | strlencxx . . $ strlen(751346f8406fd082).(message)+1); |
| 154 | |
| 155 | /* Initialize inmessage for all receives. */ |
| 156 | big_buffer = test_malloccxx . . $ test_malloc(bfcfa4d6b7f7ef64).(REALLY_BIGcxx . . $ `src/testlib/sctputil.h:65:9`!); |
| 157 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(&inmessage, 0, sizeof(inmessage)); |
| 158 | iov.iov_basecxx . . $ iovec#iov_base. = big_buffer; |
| 159 | iov.iov_lencxx . . $ iovec#iov_len. = REALLY_BIGcxx . . $ `src/testlib/sctputil.h:65:9`!; |
| 160 | inmessage.msg_iovcxx . . $ msghdr#msg_iov. = &iov; |
| 161 | inmessage.msg_iovlencxx . . $ msghdr#msg_iovlen. = 1; |
| 162 | inmessage.msg_controlcxx . . $ msghdr#msg_control. = incmsg; |
| 163 | |
| 164 | /* Get the communication up message on all client sockets. */ |
| 165 | for (i = 0; i < MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`!; i++) { |
| 166 | inmessage.msg_controllencxx . . $ msghdr#msg_controllen. = sizeof(incmsg); |
| 167 | error = test_recvmsgcxx . . $ test_recvmsg(2284ea468be03a33).(clt_sk[i], &inmessage, MSG_WAITALLcxx . . $ `<external>/8962547315054503424/socket.h:230:9`!); |
| 168 | test_check_msg_notificationcxx . . $ test_check_msg_notification(bda0d4705bf9b0d0).(&inmessage, error, |
| 169 | sizeof(struct sctp_assoc_changecxx . . $ sctp_assoc_change#), |
| 170 | SCTP_ASSOC_CHANGEcxx . . $ `<external>/17169092326581286071/sctp.h:666:9`!, SCTP_COMM_UPcxx . . $ SCTP_COMM_UP.); |
| 171 | #if 0 |
| 172 | sac = (struct sctp_assoc_change *)iov.iov_base; |
| 173 | clt_associd[i] = sac->sac_assoc_id; |
| 174 | #endif |
| 175 | } |
| 176 | |
| 177 | /* Get the communication up message and the data message on the |
| 178 | * server sockets for all the clients. |
| 179 | */ |
| 180 | for (i = 0; i < MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`!; i++) { |
| 181 | inmessage.msg_controllencxx . . $ msghdr#msg_controllen. = sizeof(incmsg); |
| 182 | error = test_recvmsgcxx . . $ test_recvmsg(2284ea468be03a33).(svr_sk, &inmessage, MSG_WAITALLcxx . . $ `<external>/8962547315054503424/socket.h:230:9`!); |
| 183 | test_check_msg_notificationcxx . . $ test_check_msg_notification(bda0d4705bf9b0d0).(&inmessage, error, |
| 184 | sizeof(struct sctp_assoc_changecxx . . $ sctp_assoc_change#), |
| 185 | SCTP_ASSOC_CHANGEcxx . . $ `<external>/17169092326581286071/sctp.h:666:9`!, SCTP_COMM_UPcxx . . $ SCTP_COMM_UP.); |
| 186 | sac = (struct sctp_assoc_changecxx . . $ sctp_assoc_change# *)iov.iov_basecxx . . $ iovec#iov_base.; |
| 187 | svr_associd[i] = sac->sac_assoc_idcxx . . $ sctp_assoc_change#sac_assoc_id.; |
| 188 | |
| 189 | inmessage.msg_controllencxx . . $ msghdr#msg_controllen. = sizeof(incmsg); |
| 190 | error = test_recvmsgcxx . . $ test_recvmsg(2284ea468be03a33).(svr_sk, &inmessage, MSG_WAITALLcxx . . $ `<external>/8962547315054503424/socket.h:230:9`!); |
| 191 | test_check_msg_datacxx . . $ test_check_msg_data(87a4c472fd2f0d28).(&inmessage, error, strlencxx . . $ strlen(751346f8406fd082).(message) + 1, |
| 192 | MSG_EORcxx . . $ `<external>/8962547315054503424/socket.h:228:9`!, stream, ppid); |
| 193 | } |
| 194 | |
| 195 | /* Branch off all the associations on the server socket to separate |
| 196 | * individual sockets. |
| 197 | */ |
| 198 | for (i = 0; i < MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`!; i++) |
| 199 | peeloff_sk[i] = test_sctp_peeloffcxx . . $ test_sctp_peeloff(9b79fb6aee4c0440).(svr_sk, svr_associd[i]); |
| 200 | |
| 201 | tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "sctp_peeloff"); |
| 202 | |
| 203 | errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! = 0; |
| 204 | /* Verify that a peeled off socket is not allowed to do a listen(). */ |
| 205 | error = listencxx . . $ listen(9b79fb6aee4c0440).(peeloff_sk[0], 1); |
| 206 | if (error != -1) |
| 207 | tst_brkmcxx . . $ `src/testlib/sctputil.h:116:9`!(TBROK, tst_exit, "listen on a peeled off socket " |
| 208 | "error: %d, errno: %d", error, errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!); |
| 209 | |
| 210 | tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "listen on a peeled off socket"); |
| 211 | |
| 212 | errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! = 0; |
| 213 | /* Verify that an association cannot be branched off an already |
| 214 | * peeled-off socket. |
| 215 | */ |
| 216 | if ((-1 != sctp_peeloffcxx . . $ sctp_peeloff(9b79fb6aee4c0440).(peeloff_sk[0], svr_associd[0])) || |
| 217 | (EINVALcxx . . $ `<external>/8987895939074593727/errno-base.h:26:9`! != errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)) |
| 218 | tst_brkmcxx . . $ `src/testlib/sctputil.h:116:9`!(TBROK, tst_exit, "sctp_peeloff on a peeled off " |
| 219 | "socket error:%d, errno:%d", |
| 220 | error, errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!); |
| 221 | |
| 222 | tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "sctp_peeloff on a peeled off socket"); |
| 223 | |
| 224 | /* Send a message from all the client sockets to the server socket. */ |
| 225 | for (i = 0; i < MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`!; i++) |
| 226 | test_sendmsgcxx . . $ test_sendmsg(c45a39c477f473e).(clt_sk[i], &outmessage, 0, strlencxx . . $ strlen(751346f8406fd082).(message)+1); |
| 227 | |
| 228 | /* Receive the sent messages on the peeled off server sockets. */ |
| 229 | for (i = 0; i < MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`!; i++) { |
| 230 | inmessage.msg_controllencxx . . $ msghdr#msg_controllen. = sizeof(incmsg); |
| 231 | error = test_recvmsgcxx . . $ test_recvmsg(2284ea468be03a33).(peeloff_sk[i], &inmessage, MSG_WAITALLcxx . . $ `<external>/8962547315054503424/socket.h:230:9`!); |
| 232 | test_check_msg_datacxx . . $ test_check_msg_data(87a4c472fd2f0d28).(&inmessage, error, strlencxx . . $ strlen(751346f8406fd082).(message) + 1, |
| 233 | MSG_EORcxx . . $ `<external>/8962547315054503424/socket.h:228:9`!, stream, ppid); |
| 234 | } |
| 235 | |
| 236 | tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "Receive msgs on peeled off sockets"); |
| 237 | |
| 238 | /* Send a message from all the peeled off server sockets to the client |
| 239 | * sockets. |
| 240 | */ |
| 241 | for (i = 0; i < MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`!; i++) { |
| 242 | outmessage.msg_namecxx . . $ msghdr#msg_name. = &clt_loop[i]; |
| 243 | outmessage.msg_namelencxx . . $ msghdr#msg_namelen. = sizeof(clt_loop[i]); |
| 244 | test_sendmsgcxx . . $ test_sendmsg(c45a39c477f473e).(peeloff_sk[i], &outmessage, 0, strlencxx . . $ strlen(751346f8406fd082).(message)+1); |
| 245 | } |
| 246 | |
| 247 | /* Receive the messages sent from the peeled of server sockets on |
| 248 | * the client sockets. |
| 249 | */ |
| 250 | for (i = 0; i < MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`!; i++) { |
| 251 | inmessage.msg_controllencxx . . $ msghdr#msg_controllen. = sizeof(incmsg); |
| 252 | error = test_recvmsgcxx . . $ test_recvmsg(2284ea468be03a33).(clt_sk[i], &inmessage, MSG_WAITALLcxx . . $ `<external>/8962547315054503424/socket.h:230:9`!); |
| 253 | test_check_msg_datacxx . . $ test_check_msg_data(87a4c472fd2f0d28).(&inmessage, error, strlencxx . . $ strlen(751346f8406fd082).(message) + 1, |
| 254 | MSG_EORcxx . . $ `<external>/8962547315054503424/socket.h:228:9`!, stream, ppid); |
| 255 | } |
| 256 | |
| 257 | tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "Send msgs on peeled off sockets"); |
| 258 | |
| 259 | errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! = 0; |
| 260 | /* Verify that a peeled-off socket cannot initialize a new |
| 261 | * association by trying to send a message to a client that is not |
| 262 | * associated with the peeled-off socket. |
| 263 | * The message is sent to the client that is associated with the |
| 264 | * socket. |
| 265 | */ |
| 266 | outmessage.msg_namecxx . . $ msghdr#msg_name. = &clt_loop[1]; |
| 267 | outmessage.msg_namelencxx . . $ msghdr#msg_namelen. = sizeof(clt_loop[1]); |
| 268 | test_sendmsgcxx . . $ test_sendmsg(c45a39c477f473e).(peeloff_sk[0], &outmessage, 0, strlencxx . . $ strlen(751346f8406fd082).(message)+1); |
| 269 | |
| 270 | inmessage.msg_controllencxx . . $ msghdr#msg_controllen. = sizeof(incmsg); |
| 271 | error = test_recvmsgcxx . . $ test_recvmsg(2284ea468be03a33).(clt_sk[0], &inmessage, MSG_WAITALLcxx . . $ `<external>/8962547315054503424/socket.h:230:9`!); |
| 272 | test_check_msg_datacxx . . $ test_check_msg_data(87a4c472fd2f0d28).(&inmessage, error, strlencxx . . $ strlen(751346f8406fd082).(message) + 1, |
| 273 | MSG_EORcxx . . $ `<external>/8962547315054503424/socket.h:228:9`!, stream, ppid); |
| 274 | |
| 275 | tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "peeled off socket cannot initialize a new assoc"); |
| 276 | |
| 277 | closecxx . . $ close(7864480464b09eea).(svr_sk); |
| 278 | |
| 279 | /* Close all the peeled off server sockets. */ |
| 280 | for (i = 0; i < MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`!; i++) |
| 281 | closecxx . . $ close(7864480464b09eea).(peeloff_sk[i]); |
| 282 | |
| 283 | /* Get the shutdown complete notification from all the client |
| 284 | * sockets. |
| 285 | */ |
| 286 | for (i = 0; i < MAX_CLIENTScxx . . $ `src/func_tests/test_peeloff.c:59:9`!; i++) { |
| 287 | inmessage.msg_controllencxx . . $ msghdr#msg_controllen. = sizeof(incmsg); |
| 288 | error = test_recvmsgcxx . . $ test_recvmsg(2284ea468be03a33).(clt_sk[i], &inmessage, MSG_WAITALLcxx . . $ `<external>/8962547315054503424/socket.h:230:9`!); |
| 289 | test_check_msg_notificationcxx . . $ test_check_msg_notification(bda0d4705bf9b0d0).(&inmessage, error, |
| 290 | sizeof(struct sctp_assoc_changecxx . . $ sctp_assoc_change#), |
| 291 | SCTP_ASSOC_CHANGEcxx . . $ `<external>/17169092326581286071/sctp.h:666:9`!, |
| 292 | SCTP_SHUTDOWN_COMPcxx . . $ SCTP_SHUTDOWN_COMP.); |
| 293 | |
| 294 | closecxx . . $ close(7864480464b09eea).(clt_sk[i]); |
| 295 | } |
| 296 | |
| 297 | freecxx . . $ free(5d22bdacc48458e8).(big_buffer); |
| 298 | /* Indicate successful completion. */ |
| 299 | return 0; |
| 300 | } |