Skip to content

Commit

Permalink
Set default MTU for an endpoint to 9000 bytes.
Browse files Browse the repository at this point in the history
  • Loading branch information
tuexen committed Mar 16, 2020
1 parent a427772 commit 0c9e649
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions programs/ekr_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ main(int argc, char *argv[])
{
struct sockaddr_in sin_s, sin_c;
struct sockaddr_conn sconn;
struct sctp_paddrparams paddrparams;
#ifdef _WIN32
SOCKET fd_c, fd_s;
#else
Expand Down Expand Up @@ -413,6 +414,17 @@ main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
debug_printf("to %d.\n", cur_buf_size);
memset(&paddrparams, 0, sizeof(struct sctp_paddrparams));
paddrparams.spp_address.ss_family = AF_CONN;
#ifdef HAVE_SCONN_LEN
paddrparams.spp_address.ss_len = sizeof(struct sockaddr_conn);
#endif
paddrparams.spp_flags = SPP_PMTUD_DISABLE;
paddrparams.spp_pathmtu = 9000;
if (usrsctp_setsockopt(s_c, IPPROTO_SCTP, SCTP_PEER_ADDR_PARAMS, &paddrparams, sizeof(struct sctp_paddrparams)) < 0) {
perror("usrsctp_setsockopt");
exit(EXIT_FAILURE);
}
if ((s_l = usrsctp_socket(AF_CONN, SOCK_STREAM, IPPROTO_SCTP, receive_cb, NULL, 0, &fd_s)) == NULL) {
perror("usrsctp_socket");
exit(EXIT_FAILURE);
Expand Down

0 comments on commit 0c9e649

Please sign in to comment.