aboutsummaryrefslogtreecommitdiff
path: root/programs/ekr_loop_upcall.c
diff options
context:
space:
mode:
authorFelix Weinrank <weinrank@fh-muenster.de>2018-07-31 15:27:40 +0200
committerFelix Weinrank <weinrank@fh-muenster.de>2018-07-31 15:27:40 +0200
commit111283a6105f6e5a516c0b04ec0479654e49554e (patch)
treeefff4e977e7cc0cf09cbadaa9621e6a339842a50 /programs/ekr_loop_upcall.c
parent91645f24777220f8775f4328413d9aa47d2e7986 (diff)
downloadusrsctp-111283a6105f6e5a516c0b04ec0479654e49554e.tar.gz
Enable RCVINFO
Diffstat (limited to 'programs/ekr_loop_upcall.c')
-rw-r--r--programs/ekr_loop_upcall.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/programs/ekr_loop_upcall.c b/programs/ekr_loop_upcall.c
index c59d9f19..3ad58d17 100644
--- a/programs/ekr_loop_upcall.c
+++ b/programs/ekr_loop_upcall.c
@@ -316,7 +316,7 @@ main(void)
#else
pthread_t tid_c, tid_s;
#endif
- int cur_buf_size, snd_buf_size, rcv_buf_size;
+ int cur_buf_size, snd_buf_size, rcv_buf_size, on;
socklen_t opt_len;
struct sctp_sndinfo sndinfo;
char *line;
@@ -473,6 +473,12 @@ main(void)
exit(EXIT_FAILURE);
}
printf("to %d.\n", cur_buf_size);
+
+ on = 1;
+ if (usrsctp_setsockopt(s_l, IPPROTO_SCTP, SCTP_RECVRCVINFO, &on, sizeof(int)) < 0) {
+ perror("usrsctp_setsockopt");
+ exit(EXIT_FAILURE);
+ }
/* Bind the client side. */
memset(&sconn, 0, sizeof(struct sockaddr_conn));
sconn.sconn_family = AF_CONN;
@@ -519,6 +525,7 @@ main(void)
perror("usrsctp_accept");
exit(EXIT_FAILURE);
}
+
usrsctp_set_upcall(s_s, handle_upcall, &fd_s);
usrsctp_close(s_l);
@@ -527,7 +534,7 @@ main(void)
}
memset(line, 'A', LINE_LENGTH);
sndinfo.snd_sid = 1;
- sndinfo.snd_flags = 0;
+ sndinfo.snd_flags = SCTP_UNORDERED;
sndinfo.snd_ppid = htonl(DISCARD_PPID);
sndinfo.snd_context = 0;
sndinfo.snd_assoc_id = 0;