aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-04-17 16:05:22 +0200
committerHarald Welte <laforge@gnumonks.org>2017-04-17 16:05:22 +0200
commitc108c9db969c4d4abaccc88419b4ac0c44957365 (patch)
tree0ad961ddcdf8dadeafd41690d6d174c6d28234de
parentc200a956157d6ddf0ccdc6b167363c0a13536416 (diff)
SCTP: Don't enable sender_dry_event for SCTP, as it breaks Linux SCTP
Enabling sender_dry_event in SCTP_FLAGS breaks reliable delivery of DATA chunks to the scoket user on Linux. Let's avoid enabling that, while still enabling various other interesting events. See https://bugzilla.redhat.com/show_bug.cgi?id=1442784 for all related details. Change-Id: Ib616cd07a6044ca2ee7e05093b22df3369c62b56
-rw-r--r--src/stream.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/stream.c b/src/stream.c
index ed73a62..add08b8 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -50,8 +50,17 @@ static int sctp_sock_activate_events(int fd)
struct sctp_event_subscribe event;
int rc;
- /* subscribe for all events */
- memset((uint8_t *)&event, 1, sizeof(event));
+ /* subscribe for all relevant events */
+ memset((uint8_t *)&event, 0, sizeof(event));
+ event.sctp_data_io_event = 1;
+ event.sctp_association_event = 1;
+ event.sctp_address_event = 1;
+ event.sctp_address_event = 1;
+ event.sctp_send_failure_event = 1;
+ event.sctp_peer_error_event = 1;
+ event.sctp_shutdown_event = 1;
+ /* IMPORTANT: Do NOT enable sender_dry_event here, see
+ * https://bugzilla.redhat.com/show_bug.cgi?id=1442784 */
rc = setsockopt(fd, IPPROTO_SCTP, SCTP_EVENTS,
&event, sizeof(event));